python中break语句

时间:2021-02-18 13:38:19   收藏:0   阅读:0

 

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

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!