Advertisement
horozov86

5.Animals - class Animal

Jul 14th, 2023
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. from abc import ABC, abstractmethod
  2.  
  3. class Animal(ABC):
  4.     def __init__(self, name, age, gender):
  5.         self.name = name
  6.         self.age = age
  7.         self.gender = gender
  8.        
  9.     @abstractmethod
  10.     def __repr__(self):
  11.         pass
  12.    
  13.     @abstractmethod
  14.     def make_sound(self):
  15.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement