break and continue Statements, and Else Clauses on Loops : Break : Statement PYTHON TUTORIALS


PYTHON TUTORIALS » Statement » Break »

 

break and continue Statements, and Else Clauses on Loops


for n in range(210):
   for x in range(2, n):
       if n % x == 0:
           print n, 'equals', x, '*', n/x
           break
   else:
       print n, 'is a prime number'



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Statement
» Break