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:

  1. "closed: storm" if wind is 50 or more (at any hour).
  2. Otherwise, "open: lanterns on" if hour is before 6 or 20 and later.
  3. Otherwise, "open".