Step 1: While the queue lasts
Four people are waiting when the doors open. The till should call each one, then say the queue is clear:
Next, please! 4 waiting
Next, please! 3 waiting
Next, please! 2 waiting
Next, please! 1 waiting
Queue clear
Four prints would do for four people, and tomorrow there might be forty. A while loop repeats its block for as long as its condition is True:
while waiting > 0:
print(f"Next, please! {waiting} waiting")
waiting -= 1
Python tests the condition, runs the block, then goes back to the test. The last line of the block
matters most: it changes waiting, so the test eventually comes out False and the loop ends. The
line after the loop, back at the left edge, runs once when it does.
Write it in countdown.py. The check tries other queue lengths, including nobody at all.
countdown.py, the file you edit4 lines
# The morning queue. waiting is how many people are queueing when the doors open.
waiting = 4
# TODO (Step 1): call "Next, please! N waiting" while anyone is waiting, then "Queue clear".