代码:
# coding=utf-8
import random
times = 3
secret = random.randint(1,10)
print ('-------------------啦啦啦------------------')
guess = 0
print ("不妨猜一下我现在心里想的是哪个数字:")
while (guess != secret) and (times >0 ):
temp = raw_input()
while not temp.isdigit():
temp = raw_input("抱歉,您的输入