我有一个使用Python 3.7制作的乘法计算器程序。 这是我的代码:
print("***MULTIPLICATION***")
formatanswermulti = "%d is the product"
varmultione = input("Enter first number to multiply: ")
varmultitwo = input("Enter the second number to multiply he first by: ")
if varmutlione.isnumeric() and varmultitwo.isnumeric():
answer = (int(varmultione) * int(varmultitwo))
print(formatanswermulti % answer)
else:
print("That's not a number")`
每当我运行它时,我都会在输入第二个数字后立即看到答案,程序会因错误而崩溃...
if varmutlione.isnumeric() and varmultitwo.isnumeric():
NameError: name 'varmutlione' is not defined
您可以在代码的第三行上看到varmultione
被定义为输入变量。这么回事吗?