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

猜年龄-1

时间:2016-11-20 19:30:46      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:pre   man   tin   keep   confirm   trie   break   time   bre   

print("Do you have 3 chances!")
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 smaller...")
elif guess_age < age_of_oldboy:
print("Think bigger!")
count +=1
if count == 3:
countine_confirm = input("Do you want to keep guessing")
if countine_confirm !=‘n‘:
count =0
else:
print("You have tried too many times.Fuck off..")

猜年龄-1

标签:pre   man   tin   keep   confirm   trie   break   time   bre   

原文地址:http://www.cnblogs.com/chzki/p/6083042.html

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