请看代码,大佬救救我
import randomanwser=random.randint(1,1000)
count=0
print('(温馨提示:只有30次机会!!)')
while count<30:
temp=input("猜一下我心里想的那个数字:")
while not temp.isdigit:#为什么进入不到这个循环
temp=input('请输入整数!')
if temp.isdigit:
guess=int(temp)
if guess==anwser:
print("猜对啦")
break
elif guess>anwser:
print("大了")
else:
print("小了")
count=count+1
if count==30:
print("机会都用完啦,不玩啦")
少个括号
import random
anwser=random.randint(1,1000)
count=0
print('(温馨提示:只有30次机会!!)')
while count<30:
temp=input("猜一下我心里想的那个数字:")
while not temp.isdigit():#为什么进入不到这个循环
temp=input('请输入整数!')
if temp.isdigit:
guess=int(temp)
if guess==anwser:
print("猜对啦")
break
elif guess>anwser:
print("大了")
else:
print("小了")
count=count+1
if count==30:
print("机会都用完啦,不玩啦")
逃兵 发表于 2021-9-16 19:53
少个括号
啊这。。。。蟹蟹
页:
[1]