Courses / Python
8. While Loops
A while loop repeatedly executes a block of code as long as a condition is true.
1 min read Chapter 8 of 72
Python
While Loops
A while loop allows code to run repeatedly as long as a condition remains true.
"I want to keep asking for input until the user decides to stop."
A while loop executes a block of code repeatedly based on a specified condition. It continues until the condition evaluates to false.
"I want to keep asking for input until the user decides to stop."
A while loop executes a block of code repeatedly based on a specified condition. It continues until the condition evaluates to false.