📜  如何在 python 代码示例中制作随机问题生成器

📅  最后修改于: 2022-03-11 14:46:14.527000             🧑  作者: Mango

代码示例2
num1 = random.randint(1, 10)

num2 = random.randint(1, 10)

answer = int(input(f"What is {num1} + {num2}?\n"))

if answer == (num1 + num2):
    print("Correct")

else:
    print("Wrong")