import random
number = random.randint(1,100)
guess = 0
while True:
num_in = input("Input your number please:")
guess += 1
if not num_in.isdigit():
print(‘请输入数字:‘)
elif int(num_in) < 1 or int(num_in) > 100:
print("请输入1~100范围内数字:")
else:
if int(num_in) > number:
print("高于"+num_in)
elif int(num_in) < number:
print("低于"+num_in)
else:
print("你猜中了"+num_in)
user = input("Do you one more time? yes or on")
if user == ‘on‘:
break
if int(guess) > 10:
print("Your lost,game over")
break