#!/usr/bin/python
#filename:continue.py
while True:
s = input('Enter something:')
if s == 'quit':
break;
if len(s) < 3:
print('too small')
continue
print('Input is of sufficient length')
print('output something')
结果:
[(61) root@Fedora~/Note/python]#./6continue.py
Enter something:qwer
Input is of sufficient length
output something
Enter something:w
too small
Enter something:2
too small
Enter something:quit
当输入为quit时,程序结束,
当输入字符串长度小于3时,就执行continue,跳过后面从头开始执行