python中break语句

2021-02-19 06:17

阅读:658

标签:pre   col   please   nbsp   aaa   lease   bsp   inpu   python   

 

1、

aaa = "123"
answer = input("please input the answer:")
while True:
    if answer == aaa:
        break
    answer = input("please input the answer,again:")
print("right!!")

 

please input the answer:abc
please input the answer,again:741
please input the answer,again:963
please input the answer,again:123
right!!
>>> 

 

python中break语句

标签:pre   col   please   nbsp   aaa   lease   bsp   inpu   python   

原文地址:https://www.cnblogs.com/liujiaxin2018/p/14407262.html


评论


亲,登录后才可以留言!