Xavier works at a sporting goods shop in the online sales department, and he is debugging the code below, which is designed to call the purchase_items() function until all desired items have been bagged. What is wrong with the code?
1 2 3 4 5 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Staff Update : The problem was incorrectly phrased because it used the wrong variable. The problem has since been updated. For those who attempted the problem before April 3rd 10AM PST, we marked "It will not ever call the purchase_items() function" as correct" (even though it will say "The correct answer is It will purchase too many items ".)
Daniel's solution:
Infinite loop!
purchased never increases
should be