python中break语句

 

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!!
>>> 

 

posted @ 2021-02-16 19:38  小鲨鱼2018  阅读(128)  评论(0编辑  收藏  举报