Last active
          August 29, 2015 14:03 
        
      - 
      
 - 
        
Save chengjun/ef899f83e662881fb90f to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | for i in range(-10, 10): | |
| try: | |
| a = 5/i | |
| print a | |
| except: | |
| print 'i = 0' | |
| if i == 3: | |
| print "i ==3" | |
| break | |
| # run a mission many times | |
| times = 0 | |
| for i in range(-10, 10): | |
| while times < 4: | |
| try: | |
| print 5/i | |
| break # without break, dead loops! | |
| except: | |
| print 'i = 0' | |
| times +=1 | |
| if i == 3: | |
| print "i ==3" | |
| break | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment