Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
bababoy solution in Clear category for Multicolored Lamp by viktor.chyrkin
class Lamp:
li = ['Green', 'Red', 'Blue', 'Yellow']
def __init__(self):
self.cur = 'Green'
def light(self):
self.g = self.cur
if self.cur == 'Yellow':
self.cur = 'Green'
else:
self.cur = Lamp.li[Lamp.li.index(self.cur) + 1]
return self.g
Oct. 23, 2021
Comments: