Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

infinite while loop

z
zoe_matrullo (2090 points)
4 8 12
in Programming in Python by (2.1k points)
recategorized by
Hi everybody

I'm trying to complete the first optional homework and my code includes a while loop. The issue is that this specific part prevents my code from working since the loop doesn't stop running. Has anyone any advice on how to solve this problem?
378 views
closed

3 Answers

Best answer
g
gio0628sato (960 points)
2 4 9
by (960 points)
selected by
Maybe you can use the break statement???
leonardo_13 (1540 points)
6 15 22
by (1.5k points)
That's probably the best solution.
Lorenzo_Pellegrino (820 points)
2 6 10
by (820 points)
Or you can check the loop conditions and verify if at some point they get statisfied, if not, there will be the endless loop
andrea.sterbini (207920 points)
750 1267 2373
by (208k points)
Have you checked that the while condition becomes False eventually?
gabrimat (5630 points)
2 4 25
by (5.6k points)
Maybe if you are using a while loop with a counter (using while because you are checking multiple conditions) check that you have actually added the counter increase assignment. Maybe with more information I could understand better your situation.