WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Python break statement


break statement can terminate the loop before it has looped


Python break statements

Break statement can be used in both while and for loop

Example

#First example
for book in 'mystical'
 

 if book == 't':
      break
   print 'Current Letter :', letter

Current Letter : m
Current Letter : y
Current Letter : s