Advertisement
horozov86

5.Animals - class Dog

Jul 14th, 2023 (edited)
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. class Dog(Animal):
  2.    
  3.     def make_sound(self):
  4.         return "Woof!"
  5.        
  6.     def __repr__(self):
  7.        
  8.        return f"This is {self.name}. {self.name} is a {self.age} year old {self.gender} {self.__class__.__name__}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement