Python-Day1-Guessage-While

age_of_oldboy = 56
count = 0
while count <3:
age = int(input("Input the age: "))

if age==age_of_oldboy:
print("You got it.")
break
elif age > age_of_oldboy:
print("Think smaller...")
else:
print("Think bigger.")
count +=1
if count ==3:
continue_confirmation = input("Do you want to keep guessing...")
if continue_confirmation != 'n':
count = 0
else:
print("You have tried too many times!")
posted @ 2020-05-01 18:57  Carol7258  阅读(128)  评论(0)    收藏  举报