The break and continue statements : Continue « Language Basics « Python






The break and continue statements

The break and continue statements
 
count = 0
while True:
    count += 1
    # end loop if count greater than 10
    if count > 10:
       break
    # skip 5
    if count == 5:
        continue
    print count
    

           
         
  








Related examples in the same category

1.Using the continue statement in a for/in structure.Using the continue statement in a for/in structure.
2.Demonstrates the break and continue statements