LLD - Behavioral Design Patterns — Part 1
Find the bug in this command pattern example:
class Command:
def execute(self):
pass
class LightOnCommand(Command):
def __init__(self, light):
self.light = light
def execute(self):
self.light.turn_on()
class Light:
def turn_on(self):
print("Light is on")
light = Light()
command = LightOnCommand(light)
command.execute