首页 > 代码库 > 猜年龄-1

猜年龄-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