Use a canvas of any reasonable size. Across the top of the canvas are 3 stationary lightbulbs (circles).
• If a lightbulb is currently turned on, it should be colored yellow. If it’s currently turned on, it should be colored black. When your program first starts, have 1 bulb on and the other 2 off.
• When the user clicks a lightbulb: Turn that lightbulb on (if it was off) or off (if it was on).
• The background color should depend on how many lightbulbs are currently turned on. If all of them are on, it should be white. If all of them are off, it should be black. If one of them is on, it should be dark grey. If two of them are on, it should be light grey
Code needed in processing format please
import random as r
fuel = input().split()
a,b = map(int,input().split())
lumin = list(range(a,b+1))
a,b = map(float,input().split())
volume = [round(r.uniform(a, b), 1) for _ in range(len(fuel))]
number = 1
for _ in range(int(input())):
if not fuel:
print('end of choosing')
break
f = r.randrange(len(fuel))
l = r.choice(lumin)
v = r.choice(volume)
price = round(l * v, 1)
print(f'Lamp {number}: works {f},\
power {l} kd, volume {v} l, price {price}')
number += 1
Comments
Leave a comment