for...else循环
如果for循环完整结束,无break打断循环,那么执行else里面的内容,否则不执行。
while True: n = raw_input('>') for x in n: if x == 'f': print 'find it.' break else: print 'nothing find.'
如果for循环完整结束,无break打断循环,那么执行else里面的内容,否则不执行。
while True: n = raw_input('>') for x in n: if x == 'f': print 'find it.' break else: print 'nothing find.'