Created
September 14, 2022 20:20
-
-
Save saaeiddev/e12e97ad1e2253fbe9ebac8cb8905d9a to your computer and use it in GitHub Desktop.
Class and object in Python
This file contains hidden or 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 Human(): | |
| def __init__(self, name, gender, eye_color, hair, height): | |
| self.name = name | |
| self.gender = gender | |
| self.eye_color = eye_color | |
| self.hair = hair | |
| self.height = height | |
| h1 = Human("saeid", "male", "brown", "black", "180") | |
| print(h1) | |
| h2 = Human("roza", "female", "blue", "black", "176") | |
| print(h2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment