Variables are local to the functions; you need to return
the relevant values you want to share to the caller and pass them to the next function that uses them. Like this:
def get_two_nums():
...
# define the relevant variables
return op, n1, n2, ans
def question(op, num1, num2, answer):
...
# do something with the variables
Now you can call
question(*get_two_nums()) # unpack the tuple into the function parameters
or
op, n1, n2, ans = get_two_nums()
question(op, n1, n2, ans)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…