c32team

multiclass

Sep 21st, 2023
807
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Animal:
  2.     def say(self):
  3.         print('i am animal')
  4.  
  5.  
  6. class Cat(Animal):
  7.     pass
  8.  
  9.  
  10. class Robot:
  11.     def say(self):
  12.         print('i am robot')
  13.  
  14.  
  15. class RoboCat(Cat, Robot):
  16.     pass
  17.  
  18.  
  19. robo = RoboCat()
  20. robo.say()
  21.  
Add Comment
Please, Sign In to add comment