Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Turn it solution in Clear category for Multicolored Lamp by ludek.reif
class Lamp:
def __init__(self):
self.colours = ('Green', 'Red', 'Blue', 'Yellow')
self.no_click = 0
def light(self):
colour = self.colours[self.no_click % len(self.colours)]
self.no_click += 1
return colour
Sept. 23, 2019
Comments: