Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
colours[self.state] solution in Clear category for Multicolored Lamp by Olpag
class Lamp:
colours = ("Yellow", "Green", "Red", "Blue")
def __init__(self, state = 0):
self.state = state
def light(self):
self.state = (self.state + 1)%4
return self.colours[self.state]
Jan. 3, 2020
Comments: