Advertisement
horozov86

5.Animals - class Tomcat

Jul 14th, 2023
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. class Tomcat(Cat):
  2.     def __init__(self, name, age):
  3.         super().__init__(self, name, age, "Male")
  4.        
  5.     def __repr__(self):
  6.         result = f"Hiss\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