我坚持在另一个函数中使用在前一个函数中定义的变量。例如,我有这个代码:
def get_two_nums():
...
...
op = ...
num1 = ...
num2 = ...
answer = ...
def question():
response = int(input("What is {} {} {}? ".format(num1, op, num2)))
if response == answer:
.....
Run Code Online (Sandbox Code Playgroud)
我将如何在第二个函数中使用第一个函数中定义的变量?先感谢您