+ 1
Why we use infinite loop?
4 Réponses
+ 2
Wait, who said we?
Well, maybe not a true infinite loop, there should always be a condition to stop the loop. There are very little reason I can think of when someone could "use" an infinite loop, most common one is to setup a prank XD
+ 2
There are lots of scenarios, one of many can be found in video games, here is a simple example...
while player_health >= 1:
play_game()
else:
game_over()