Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Laser:
- def does(self):
- return 'disintegrate'
- class Claw:
- def does(self):
- return 'crush'
- class SmartPhone:
- def does(self):
- return 'ring'
- class Robot:
- def __init__(self):
- self.a = Laser()
- self.b = Claw()
- self.c = SmartPhone()
- def does(self):
- return f'{self.a.does()}, {self.b.does()}, {self.c.does()}'
- d = Robot()
- print(d.does())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement