Skip to content

Latest commit

 

History

History
12 lines (8 loc) · 516 Bytes

while_loop.md

File metadata and controls

12 lines (8 loc) · 516 Bytes

while loops

Like for loops, while loops are a way of going through items in a list. The difference is that while loops will continue to execute as long as a certain condition is true. To get out of the loop, use the break command, or type control-c or quit() in the interpreter. Otherwise, the loop will keep going.

while True:
    print("Oh no! I'm stuck...")

Tutorials

  • Check out this demonstration of while loops on w3schools.