def main(x1, x2, x3):
a = ops() + 10
return print("Result are ", a)
def ops():
global x1,x2, x3
y = (x1 + x2 + x3)
return y
main(10, 7, 3)
NameError: name 'x1' is not defined
As can be seen, I am declaring x1, x2 and x3 as global variables in the subordinate function and already including these variables as arguments for the main function. Appreciate any help.