哪里出错了呢?(新手求助)
import randomnum = random.randint(1,10)
print("------------MR.D出品-----------")
print("来猜猜我心中的数字:")
guess = 0
time = 3
while guess!=num and time>0:
temp=input()
if temp.isdigit():
guess = int(temp)
if guess==num:
print("你是我肚子里的蛔虫吗?")
print("猜对了也没有奖励。")
else:
if guess<num:
print("小了小了")
else:
print("大了大了")
if time>1:
print("请重新输入:",end='')
else:
print("您的机会用光了")
else:
print("您的输入有误,请输入一个整数:",end'')
time = time-1
print("game over")
print("您的机会用光了")
time = time - 1# 补一个计数器
else:
print("您的输入有误,请输入一个整数:", end='')
time = time - 1
print("game over") # 格式调整
页:
[1]