python中break语句

 

>>> while True:
    a = input("please input something:")
    if a == "ab":
        break
    else:
        print(f"you had input {a}.")

        
please input something:100
you had input 100.
please input something:abc
you had input abc.
please input something:xyz
you had input xyz.
please input something:ab

 

posted @ 2021-01-02 13:41  小鲨鱼2018  阅读(141)  评论(0编辑  收藏  举报