Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Hero: # Main class
- pass
- # No OOP
- hero1 = Hero() # Attribute/ instance/ instation
- hero2 = Hero()
- hero3 = Hero()
- hero1.name = "sniper"
- hero1.health = 100
- hero2.name = "sven"
- hero2.health = 200
- hero3.name = "ucup"
- hero3.health = 1000
- print(hero1)
- print(hero1.__dict__) # Show as dictionary
- print(hero1.name)
- # Link: https://www.youtube.com/watch?v=1PjHsUnOkes&list=PLZS-MHyEIRo7ab0-EveSvf4CLdyOECMm0&index=1
Add Comment
Please, Sign In to add comment