Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class Parrot:
  2. species = "bird"
  3. def __init__(self, name, age):
  4. self.name = name
  5. self.age = age
  6. blu = Parrot("Blu", 10)
  7. woo = Parrot("wOO", 15)
  8. print("Blu is a {}" .format(blu.__class__.species))
  9. print("Woo is also a {}".format(woo.__class__.species))
  10. print("{} is {} years old".format(blu.name, blu.age))
  11. print("{} is {} years old".format(woo.name, woo.age))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement