Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Parrot:
- species = "bird"
- def __init__(self, name, age):
- self.name = name
- self.age = age
- blu = Parrot("Blu", 10)
- woo = Parrot("wOO", 15)
- print("Blu is a {}" .format(blu.__class__.species))
- print("Woo is also a {}".format(woo.__class__.species))
- print("{} is {} years old".format(blu.name, blu.age))
- print("{} is {} years old".format(woo.name, woo.age))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement