Jorell_Ramos_Sinaga

dog.py

Jan 12th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. class Dog:
  2.  
  3. def __init__(self, name, variation):
  4. self.name = name
  5. self.variation = variation
  6. self.bark()
  7.  
  8. def sit(self):
  9. print(f"{self.name} sedang duduk santuy sambil nge-vape")
  10.  
  11. def cry(self):
  12. print(f"{self.name} : hikz ... >.<")
  13.  
  14. def bark(self):
  15. print(f"Woof Woof ....")
  16.  
  17. def sleep(self):
  18. print(f"{self.name} ngantuk zzzZZZZZ")
  19.  
  20. def eat(self):
  21. print(f"{self.name} lapar... *monch* *monch*")
  22.  
  23. dog_1 = Dog('Willie', 'Kintamani')
  24. print(dog_1.name)
  25. dog_1.sit()
  26. dog_1.cry()
  27. dog_1.sleep()
  28. dog_1.eat()
  29.  
  30. dog_2 = Dog('Bagus', 'Lokal')
  31. print(dog_2.name)
  32. dog_2.sit()
  33. dog_2.cry()
  34. dog_2.sleep()
  35. dog_2.eat()
Advertisement
Add Comment
Please, Sign In to add comment