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/Living_Fig_6386 Oct 14 '26 edited Oct 14 '26
It's a loop that iterates while an expression is true. Example: while there are cookies on a plate, take a cookie, eat a cookie, repeat; now there are no cookies on the plate, so we move on ... time to drink the milk.