Python学习之for循环
如何实现让用户不断猜年龄,但只给3次机柜,再猜不对就退出程序age_of_oldboy = 56
count = 0
for i in range(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...')
else:
print('think bigger..')
else:
print('you have tried too many times .. fuck off')
页:
[1]