A buyer compares updated stock with a target. Trace the movements before calculating the order quantity.
Predict the output
How many units of tea will the buyer order?
stock = {"tea": 4}
for delivery in [-3, 2]:
stock["tea"] += delivery
target = 6
print(max(0, target - stock["tea"]))