#只需要把input修改为raw_input就行了。还有疑问的话可以私信我
import random
number = random.randint(0,100)
count = 0
while True:
user_number = raw_input("请输入你猜的数字")
count += 1
if count >= 6:
print "超过6次结束"
break
if user_number.isdigit():
user_number = int(user_number)
if user_number > number:
print "输入数字大了"
continue
elif user_number < number:
print "输入数字小了"
continue
elif user_number == number:
print "猜对了。结果是:%s" %number
print "猜了%s次" %count
break
else:
print "输入错误"
break