'''
需求:
1、可猜三次
2、三次猜完可选择是否继续
'''
age_of_Clyde = 25
count = 0
while count < 3:
#输入默认是字符串类型,转换成int类型
age_of = int(input('age_of_Clyde:'))
if age_of == age_of_Clyde :
print('输入的年龄为:',age_of,' 正确')
break #跳出循环;continue 为跳出单次循环,继续下一次循环
elif age_of > age_of_Clyde:
print('输入的年龄为【%s】大于实际年龄'%(age_of))
else:
print('输入的年龄为【%s】小于实际年龄'%(age_of))
count +=1
if count ==3:
age = input('输入n继续,否则退出')
if age != 'n':
print('游戏结束')
break
else:
count = 0