Python while Loop Condition
Multiple Choice Easy
Question
How many times does `while False: print('hi')` execute?
Hint
The condition is checked before the first iteration.
Explanation
A while loop checks its condition before each iteration. Since False is never true, the loop body never executes — zero iterations. The condition is evaluated before the first run, so the body is skipped entirely.
Related Resources
Related Lessons
- Conditions and Loops
While loops.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.