精华 发表在 Python问题部 08-16 13:13:32
while
语法:
while 条件: 语句
如果想要像Scratch中一样创建一个永久循环,可以把条件改成'True',因为’True'当然等于'True'.
while True: print('while循环')
如果你想让循环跳回起点,可以用continue:
while True: answer = 'nihao' if answer = 'nihao': continuewhile True: exit = 'True' if exit == 'True': break
谢谢!
5 赞
3 赞
2 赞
1 赞
3 赞