Wiki

Changes between Initial Version and Version 1 of Break

Show
Ignore:
Timestamp:
03/23/10 10:39:09 (8 years ago)
Author:
hopscc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Break

    v1 v1  
     1= Break Statement = 
     2 
     3The '''break''' statement terminates the execution of the nearest enclosing loop in which it appears.  
     4Control passes to the statement that follows the terminated statement, if any. 
     5 
     6== Grammar == 
     7    break 
     8 
     9== Example == 
     10 
     11{{{ 
     12def main is shared 
     13    for i in 1 : 10 
     14        print i 
     15 
     16        if i == 4 
     17            break 
     18     
     19    # Loop exits after printing 1 through 4 
     20}}}