Open Jaro266613 opened 3 years ago
class Rectangle(): def _init(self, w, l): self.width = w self.len = l
def area(self): return self.width * self.len def change_size(self, w, l): self.width = w self.len = l
rectangle = Rectangle(10, 20) print(rectangle.area()) rectangle.change_size(20, 40) print(rectangle.area())
TypeError Traceback (most recent call last)
you missed the "" in the initialization of Rectangle class. It should be "init" but it is written as "init"
class Rectangle(): def _init(self, w, l): self.width = w self.len = l
rectangle = Rectangle(10, 20) print(rectangle.area()) rectangle.change_size(20, 40) print(rectangle.area())
TypeError Traceback (most recent call last)