0
code is not working!!!!!!1 https://sololearn.com/coach/1080/?ref=app
class Shape: def __init__(self, w, h): self.width = w self.height = h def area(self): return self.width*self.height def __add__(self, other): return Shape(self.width + self.height, other.width + other.height) def __gt__(self, other): return self.width + self.height > other.width + other.height w1 = int(input()) h1 = int(input()) w2 = int(input()) h2 = int(input()) s1 = Shape(w1, h1) s2 = Shape(w2, h2) result = s1 + s2 print(result.area()) print(s1 > s2)
2 Answers
+ 1
Code is fine. whats your input?
0
Try changing the way you get the four varoables: input1 = input().split(" ")
w1 = int(input1[0])
h1 = int(input1[1])
w2 = int(input1[2])
h2 = int(input1[3])