python_guess age

# author: Roy.G
age_of_oldboy = 56

count = 0
while count<3:
if count==3:
break
guess_age=int( input ("guess age:"))
if guess_age == age_of_oldboy:
print("yes,you got it")
elif guess_age>age_of_oldboy:
print("go smaller")
elif guess_age<age_of_oldboy:
print("go bigger")
if guess_age== age_of_oldboy:
break
count = count + 1
if count == 3:
continue_confirm=input("Do you wangt to cuntinue")
if continue_confirm != 'n':
count =0
else:
print("you have tried too many times,foolish!")

posted on 2021-12-25 19:41  ttm6489  阅读(31)  评论(0编辑  收藏  举报

导航