1 · Learn and predict
Read this worked example. Predict its output, run it in Python 3, and explain how variables change.
def discount(price, member):
if price < 0:
raise ValueError('price cannot be negative')
if member:
return round(price * 0.9, 2)
return round(price, 2)
print(discount(20, True))