我想知道我的代码出了什么问题?我使用的是python 3.0 (NVM得到了它)
import random
random.seed(1,10)
a = random.randint (1,10)
b = random.randint (1,10)
print("What is: " + str(a) + " X " + str(b) + "?")
ans = int(input("Your answer: "))
if (a * b == ans):
print ("Correct!")
else:
print ("Incorrect!")发布于 2020-05-09 13:10:49
给出代码,我只能想到缩进错误。请看下面,它是有效的-
import random
random.seed(1)
a = random.randint(1, 10)
b = random.randint(1, 10)
print("What is: {} X {}?".format(a, b))
ans = int(input("Your answer: "))
if (a * b == ans):
print("Correct!")
else:
print("Incorrect!")也可以看到截图-

Here是访问集成开发环境的网址。
https://stackoverflow.com/questions/61692009
复制相似问题