Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Dumb solution in Clear category for Multicolored Lamp by obone
LIGHTS = ['Yellow', 'Green', 'Red', 'Blue']
class Lamp:
def __init__(self):
self.index = 0
def light(self):
self.index = (self.index + 1) % len(LIGHTS)
return LIGHTS[self.index]
June 25, 2019