Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Modulo solution in Clear category for Multicolored Lamp by rodka81
class Lamp:
COLORS = ["Green", "Red", "Blue", "Yellow"]
def __init__(self):
self._color = -1
def light(self):
self._color = (self._color + 1) % len(self.COLORS)
return self.COLORS[self._color]
March 28, 2019
Comments: