import random
x = random.randrange(11)
z = random.randrange(11)
y = random.choice('-+*')
print("what is?", x, y, z)
ans1 = int(input())
if ans1 == (x, y, z):
print("correct")
score = score + 1
else:
print("incorrect,the answer is", x, y, z)
例輸入和輸出不正確的數學問題:如何使Python制定出由變數
what is? 2 * 6
12
incorrect,the answer is 2 * 6
如何使它打印the answer is 12
?我需要以某種方式評估表達。
你的問題在哪裏? –
我該如何回答一個由變量組成的數學問題-x,y,z –
theres也有問題,我的代碼可以糾正它 –