I want to change python function to return two values. How to achieve this without affecting any of the previous function calls that expect only one return value?
For instance,
Original definition:
def foo():
x = 2
y = 2
return (x+y)
sum = foo ()
Ne Definition:
def foo():
x = 2
y = 2
return (x+y), (x-y)
sum, diff = foo ()
I want to make this so that the previous foo call also remains valid? Is it possible?
source
share