Step 1: Opening hours
The Order Queue's while loops ran until something happened. When you know the numbers to walk
through, a for loop is shorter. range(OPEN, CLOSE) gives every whole number from OPEN up to
CLOSE, and the loop runs once for each:
for hour in range(OPEN, CLOSE):
print(f"{hour}:00")
Each turn, hour holds the next number. range stops before its end, so with the doors closing
at 19:00 the last hour on the sheet starts at 18:00. Print the sheet's hours, 7:00 to 18:00.
Use OPEN and CLOSE in the loop: the check changes them to other opening times.
stock.py, the file you edit10 lines
# Croissants at Bean There: the stock sheet, hour by hour.
OPEN = 7 # the doors open at 7:00
CLOSE = 19 # and close at 19:00
croissants = 40 # baked this morning
RUSH = 6 # sold an hour in the morning rush, 8:00 to 10:00
LUNCH = 4 # sold an hour at lunch, 12:00 to 14:00
QUIET = 2 # sold an hour the rest of the day
# TODO (Step 1): print every opening hour, 7:00 to 18:00, one a line