0

What is the problem??

class Rectangle: def __init__(self, larg, alt): self.larg = larg self.alt = alt def area(self): return self.larg * self.alt @classmethod def square(cls, lado): return cls(lado, lado) quadrado = Rectangle.square(5) print (quadrado.area())

23rd Jul 2016, 7:30 PM
Abel Fernando Barros Rodrigues
Abel Fernando Barros Rodrigues - avatar
2 Answers
0
You aren't defining Rectangle as an object first. R = Rectangle(x, y) R.area()
23rd Jul 2016, 10:09 PM
jj Fer
jj Fer - avatar
- 1
sorry but i can't understand u
23rd Jul 2016, 10:13 PM
Abel Fernando Barros Rodrigues
Abel Fernando Barros Rodrigues - avatar