+ 4
How to terminate an infinite loop ?
15 ответов
+ 6
Use if conditional and break;
+ 5
Use some conditional statement and break the loop using break;
+ 2
you can also use return if you want to end the function also
+ 2
Break is best
+ 2
Ferran Esparza I think OP meant to stop it programatically.
+ 2
Bebida Roja I think so. But I needed to say that option
+ 2
Apply conditional statement for checking user input
if input != some_value:
break
+ 2
Using break and conditional statement 👍
+ 2
To terminate an infinite loop just use the Break function
+ 1
Use if conditions
+ 1
Ctrl +C
+ 1
I wanted to know how to end an infinite loop on a particular user input. But thanks for all the varied answers
+ 1
1. use conditional loops with break or 2. press the stop button when u run an infinite loop , hope it helps
0
Ferran Esparza You had the need lol
0
Ask the user how many times should ut execute and then use if statement and break it