码迷,mamicode.com
首页 > 其他好文 > 详细

任性玩 while

时间:2019-05-18 00:46:57      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:bsp   span   guess   pre   col   big   ant   conf   +=   

age_of_me = 17

count = 0
while count < 5:
    guess_age = int(input("guess age:"))
    if guess_age == age_of_me :
        print("yes,you get it.")
        break
    elif guess_age > age_of_me:
        print("guess smaller")
    else:
        print("guess bigger")
    count +=1
    if count == 5:
        countine_confirm = input("do you want go on:")
        if countine_confirm != n:
            count = 0

 

任性玩 while

标签:bsp   span   guess   pre   col   big   ant   conf   +=   

原文地址:https://www.cnblogs.com/0815tang/p/10884304.html

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