MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PythonLearning/comments/1x5t0ra/while_loop/pgqlbtk/?context=3
r/PythonLearning • u/Monesh_peterson1025 • Oct 14 '26
can anybody explain the concept of while loop
38 comments sorted by
View all comments
14
The body is repeated while the condition is true. That's it.
2 u/Sure-Passion2224 Oct 14 '26 Also, and I've seen a lot of new coders fall to this, the loop control variable must change in the loop in order to exit the loop. 6 u/tiredITguy42 Oct 14 '26 edited Oct 14 '26 You can break.BTW. while True is usefull as well.
2
Also, and I've seen a lot of new coders fall to this, the loop control variable must change in the loop in order to exit the loop.
6 u/tiredITguy42 Oct 14 '26 edited Oct 14 '26 You can break.BTW. while True is usefull as well.
6
You can break.
break
BTW. while True is usefull as well.
while True
14
u/csabinho Oct 14 '26
The body is repeated while the condition is true. That's it.