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!")

浙公网安备 33010602011771号