Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Multicolored Lamp by tokiojapan55
class Lamp:
colors = ["Green", "Red", "Blue", "Yellow"]
state = -1
def light(self):
self.state = (self.state + 1) % 4
return self.colors[self.state]
June 23, 2020