1 · Understand
Normal, boundary and invalid data; trace and fix. Study the code and predict what it does before running it. Change a value or string and observe how the output changes.
def discount(price):
if price >= 20:
return price * 0.9
return price
for value in (19.99, 20, 20.01):
print(value, discount(value))Download example .py ↓