Advertisement
simeonshopov

Mammals

May 27th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. class  Mammal:
  2.     __kingdom = "animals"
  3.  
  4.     def __init__(self, name, type, sound):
  5.         self.name = name
  6.         self.type =type
  7.         self.sound = sound
  8.  
  9.     def make_sound(self):
  10.         return f'{self.name} makes {self.sound}'
  11.  
  12.     @staticmethod
  13.     def get_kingdom():
  14.         return Mammal.__kingdom
  15.  
  16.     def info(self):
  17.         return f'{self.name} is of type {self.type}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement