SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top