请教: if guess > temp: 为啥有错?
python3吧
全部回复
仅看楼主
level 5
tsavosg 楼主
print ("数字输入测试")
import random
guess = 0
temp = random.randint(1,10)
while guess != temp:
guess = input("来,输入一个正整数吧")
if guess == temp:
print("great!你猜对了")
else:
if guess > temp:
print("猜大了!")
else:
print("猜小了!")
print("see u next time")
print("测试结束")
2021年01月09日 16点01分 1
level 11
int(input("来……"))
2021年01月09日 17点01分 2
泄泻大佬[太开心]
2021年01月10日 00点01分
level 6
你输入的默认是字符串
2021年01月09日 23点01分 3
嗷!
2021年01月10日 00点01分
1