Please enable JavaScript to use CodeHS

CodeHS Glossary


While Loop Python

Lets us repeat code as long as something is true.

x=1
while x > 3 :
    print "This will print as long as x is less than 3"
    x += 1  # this line increases x by one at each loop iteration