Guess 任意猜

 1 age_of_oldboy = 56
 2 count = 0
 3 while count <3:
 4     guess_age = int(input("guess age:"))
 5     if guess_age == age_of_oldboy:
 6        print ("yes,you got it.")
 7        break
 8     elif guess_age > age_of_oldboy:
 9         print("think smaller...")
10     else:
11         print("think bigger!")
12         count +=1
13     if count == 3:
14         countine_confirm =input("do you want to keep guessing...?")
15         if countine_confirm !="n":
16             count =0

posted on 2017-08-03 23:16  aiaiduo  阅读(117)  评论(0编辑  收藏  举报

导航