码迷,mamicode.com
首页 > 编程语言 > 详细

python中break语句

时间:2021-02-18 13:38:19      阅读:0      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!