diff --git a/thinkcspy/Chapter-16-Exercises/Problem9and10_gallons.py b/thinkcspy/Chapter-16-Exercises/Problem9and10_gallons.py index f1af4ac..bb5653a 100644 --- a/thinkcspy/Chapter-16-Exercises/Problem9and10_gallons.py +++ b/thinkcspy/Chapter-16-Exercises/Problem9and10_gallons.py @@ -5,6 +5,10 @@ def fillJug(rounds, jugA, jugB, target): pour = 0 + if target > jugA["cap"]: + print("Target is too high. Reducing target to Jug A's capacity.") + target = jugA["cap"] + if jugA["state"] == target: print("Target reached") return