Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class Parrot:
  2. def __init__(self, name, age):
  3. self.name = name
  4. self.age = age
  5. def sing(self, song):
  6. return "{} sings {}".format(self.name, song)
  7. def dance(self):
  8. return "{} is now dancing".format(self.name)
  9. blu = Parrot("Blu", 10)
  10. print(blu.sing("'happy'"))
  11. print(blu.dance())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement