该程序的目标是让两个小于 12 的随机数相乘并让用户猜测答案。到目前为止我有这个。. .
import random
g=0
while g<10:
variable_1 = random.randint (0,13)
variable_2 = random.randint (0,13)
answer = variable_1 * variable_2
guess = input("What is 'variable_1' x 'variable_2'?")
if guess == answer:
print "Correct!"
else:
print "Incorrect!"
问题是输入框字面意思是“什么是 Variable_1 x Variable_2?”。但是,我希望它在输入框中具有变量的值。有没有办法做到这一点?