Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Multicolored Lamp solution in Clear category for Multicolored Lamp by JimmyCarlos
class Lamp(object):
def __init__(self):
self.colours = ["*"] + ["Green","Red","Blue","Yellow"] # Anchored ("*" could mean off)
self.currentColourIndex = 0
def light(self):
if self.currentColourIndex != len(self.colours[1:]):
self.currentColourIndex += 1
else:
self.currentColourIndex = 1
return self.colours[self.currentColourIndex]
July 28, 2018
Comments: