class LampController: def __init__(self): self.lamp = Lamp() def turn_on(self): self.lamp.set_on() def turn_off(self): self.lamp.set_off() def is_on(self): return self.lamp.get_state()
class LampController: def __init__(self): self.lamp = Lamp() def set_on(self): # Change lamp status to ON self.lamp.set_on() def set_off(self): self.lamp.set_off() def get_status(self): # Returns True if lamp is ON return self.lamp.is_on()