||
Continue statements
If the continue function is executed, go back to the start of the clause of the while loop.
Example:
while True:
print('please type your name')
name=input()
if name!='Jack':
continue
print('type your password')
password=input()
if password=='password':
break
print('Welcome to Python'+name)
Nb: if the username is
Jack, type and match the password. Otherwise, go back to the beginning of the while loop.Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-4-27 05:56
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社