Demonstrates the break and continue statements : Continue « Language Basics « Python






Demonstrates the break and continue statements

 

count = 0
while True:
    count += 1

    if count > 10:
       break
    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.The break and continue statementsThe break and continue statements