python_11_guess任性玩

age_of_oldboy=56
count=0
while count<3:
    guess_age=int(input("guess age:"))
    if guess_age==age_of_oldboy:
        print("yes,you got it.")
        break#结束整个循环
    elif guess_age<age_of_oldboy:
        print("think bigger!")
    else:
        print('think smaller...')
    count+=1
    if count==3:
        continue_confirm=input("Do you want to keep guessing? y or n")
        if continue_confirm!="n":
            count=0

  

posted @ 2018-01-03 09:21  耐烦不急  阅读(191)  评论(0编辑  收藏  举报