-2
這是我的代碼:的Python 3.4.1 - 把變量放入輸入
import random
x = random.randint(2,10)
y = random.randint(2,10)
answer = int(input("How much is x * y?"))
我有我的輸入使用變量x, y
,因此用戶會看到這個當它們運行的程序(該程序顯然是沒有完成,我只需要這個幫助):
How much is 3 * 5?
但我不知道如何把這些變量內的輸入..請幫助!
應該使用.format而不是舊的%運算符 – 2014-10-18 15:59:43