1.for循环 #!/usr/bin/evn python #Filename: for.py for i in range(1, 5): print i else: print ‘The for loop is over‘ 2.break语句 #!/usr/bin/evn python #filename: break.py while True: s = raw_input(‘Enter something : ‘) if s == ‘quit‘: break print ‘Length of the string is‘, len(s) print ‘Done‘ 3.continue语句 #!/usr/bin/evn python #filename: continue.py while True: s = raw_input(‘Enter something:‘) if s == ‘quit‘: break if len(s) < 3: continue print ‘Input is of sufficient length‘
本文出自 “笔记” 博客,请务必保留此出处http://sunflower2.blog.51cto.com/8837503/1546260
原文地址:http://sunflower2.blog.51cto.com/8837503/1546260