||
break statements
Function: break while loop. If the break statement is executed, the while loop is terminated.
Example
Code in Pytho-Note-2-while loop name='' while name!='your name': print('please type your name') name=input() print('thank you') | name='' while True: print('please type your name') name=input() if name=='your name': break print('thank you') |
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-4-25 03:16
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社