Advertisement
horozov86

5.Animals - class Kitten

Jul 14th, 2023 (edited)
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. class Kitten(Cat):
  2.     def __init__(self, name, age):
  3.         super().__init__(self, name, age, "Female")
  4.        
  5.     def __repr__(self):
  6.         result = f"Meow\n"
  7.         result += f"This is {self.name}. {self.name} is a {self.age} year old {self.gender} {self.__class__.__name__}"
  8.         return result
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement