Advertisement
maxim_shlyahtin

Task_4.1

Oct 24th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. class Laser:
  2. def does(self):
  3. return 'disintegrate'
  4.  
  5.  
  6. class Claw:
  7. def does(self):
  8. return 'crush'
  9.  
  10.  
  11. class SmartPhone:
  12. def does(self):
  13. return 'ring'
  14.  
  15.  
  16. class Robot:
  17. def __init__(self):
  18. self.a = Laser()
  19. self.b = Claw()
  20. self.c = SmartPhone()
  21. def does(self):
  22. return f'{self.a.does()}, {self.b.does()}, {self.c.does()}'
  23.  
  24. d = Robot()
  25. print(d.does())
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement