
Checkpoint
Checkpoint: The Glass Bridge
The glass bridge to Lumen is beautiful, but dangerous in strong wind. Its sign must always show the right message. The bridge keeper asks you to program it.
This checkpoint uses the whole chapter: comparisons, if,
elif, else and or. Remember that Python checks the
branches from top to bottom and stops at the first true one.
wind is the wind speed, and hour is the time of day,
from 0 to 23.
Assignment
Complete bridge_sign(wind, hour) so it returns:
"closed: storm"ifwindis 50 or more (at any hour).- Otherwise,
"open: lanterns on"ifhouris before6or20and later. - Otherwise,
"open".
Complete bridge_sign(wind, hour) so it returns:
"closed: storm"ifwindis 50 or more (at any hour).- Otherwise,
"open: lanterns on"ifhouris before6or20and later. - Otherwise,
"open".
main.py Python sleeping
Press Run to try your code, then Check to test it.