0
Can someone please make a lamp algorithm as an example?
The lamp is broken. It is also plugged in and the bulb is not burnt out. If it is not plugged in, then plug it in. Else, If the bulb is burnt out, then replace it. Else, Repair lamp.
1 Resposta
+ 18
You have 3 booleans there:
broken = True
pluggedIn = True
burntout = False
Now you need to implement the if-elif-else