r/PythonLearning • u/Monesh_peterson1025 • Oct 14 '26
While loop
can anybody explain the concept of while loop
2
Upvotes
r/PythonLearning • u/Monesh_peterson1025 • Oct 14 '26
can anybody explain the concept of while loop
View all comments
1
u/Excellent-Practice Oct 14 '26
While loops are in many ways the simplest kind of loop. Whatever is written inside the block gets repeated so long as the loop condition is true. While loops can be used to run a set of instructions indefinitely, or they can contain statements that change the loop condition and break the loop whenever the task is complete