Advertisement
horozov86

mammal_testing_exercise

Jul 25th, 2023
137
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.     def __init__(self, name, mammal_type, sound):
  3.         self.name = name
  4.         self.type = mammal_type
  5.         self.sound = sound
  6.         self.__kingdom = "animals"
  7.  
  8.     def make_sound(self):
  9.         return f"{self.name} makes {self.sound}"
  10.  
  11.     def get_kingdom(self):
  12.         return self.__kingdom
  13.  
  14.     def info(self):
  15.         return f"{self.name} is of type {self.type}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement