Last active
February 14, 2022 01:21
-
-
Save pknowledge/ba3095325dc7a4b93b5fa2f2887dfa35 to your computer and use it in GitHub Desktop.
__init__and_self_in_python_rectangle.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Rectangle: | |
def __init__(self, height, width): | |
self.height = height | |
self.width = width | |
rect1 = Rectangle(20, 60) | |
rect2 = Rectangle(50, 40) | |
print(rect1.height * rect1.width) | |
print(rect2.height * rect2.width) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment