Step 1: True or False
Is it happy hour? A till can't answer "sort of": it needs yes or no. In Python those are True and
False, and a comparison gives you one of them:
print(16 > 15) # True
print(16 == 15) # False: == asks "are they equal?"
print(16 != 15) # True: != asks "are they different?"
= puts a value in a variable; == compares. Mixing them up is the most common slip in this
level, and Python points it out with a SyntaxError if you write if hour = 15.
Happy hour runs from 15:00 up to, but not including, 17:00. Python lets you chain two comparisons the way maths does:
15 <= hour < 17
In prices.py, keep that in a variable called happy and print it:
Happy hour: True
Change hour to 14 and run it, then 16, then 17, to watch it flip. The check tries those hours too.
prices.py, the file you edit9 lines
# Bean There's prices, in whole pennies. Sam runs a happy hour from 3pm until 5pm.
FLAT_WHITE = 320
HAPPY_PRICE = 250
hour = 15 # the hour on the till's clock, 0 to 23
# TODO (Step 1): keep whether it's happy hour (15:00 up to, but not including, 17:00) in a
# variable called happy, and print it:
# Happy hour: True