We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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) in ----> 1 rectangle = Rectangle(10, 20) 2 print(rectangle.area()) 3 rectangle.change_size(20, 40) 4 print(rectangle.area())
TypeError: Rectangle() takes no arguments
The text was updated successfully, but these errors were encountered:
you missed the "__" in the initialization of Rectangle class. It should be "init" but it is written as "__init"
Sorry, something went wrong.
No branches or pull requests
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)
in
----> 1 rectangle = Rectangle(10, 20)
2 print(rectangle.area())
3 rectangle.change_size(20, 40)
4 print(rectangle.area())
TypeError: Rectangle() takes no arguments
The text was updated successfully, but these errors were encountered: