When I try to call a, b in function add, I get a is not defined even though I am returning the values. How do I make it return both a and b?
def numbers():
a= input ("a:")
a = int(a)
b= input ("b:")
b = int(b)
return a
return b
def add():
numbers()
print (a)
print (b)
add()
add, the result from thenumbers()call needs to be assigned to local names, or else used directly. Callingnumbers()does not create localaandbvariables. The error message only complains aboutabecause the error causes the program to terminate; there is no opportunity to complain aboutb, but it would if it got that far.