标签:off big try think print 年龄 range wan +=
_oldboy_age = 56
count = 0
while count <3:
guess_age = int(input("guess_age:"))
if guess_age == _oldboy_age:
print("yes ,you right!")
break
elif guess_age > _oldboy_age:
print("think smaller")
else:
print("think bigger")
count +=1
if count == 3:
confirm = input("Do want to keep guessing?")
if confirm != ‘n‘:
count = 0
else:
print("you have try too much times,get off!")
--------------------------------------------------------------
_oldboy_age = 56
for a in range(3):
guess_age = int(input("guess_age:"))
if guess_age == _oldboy_age:
print("yes ,you right!")
break
elif guess_age > _oldboy_age:
print("think smaller")
else:
print("think bigger")
else:
print("you have try too much times,get off!")
标签:off big try think print 年龄 range wan +=
原文地址:http://www.cnblogs.com/szchenh2010/p/7638035.html