猜年龄-1

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了猜年龄-1相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

python_猜年龄,有三次机会

递归推导——猜年龄

While循环猜年龄

猜年龄

猜年龄游戏,输入数字,直到猜对为止

随机数猜年龄游戏