What actually happens when returning multiple values in a function?

I’m having trouble understanding the purpose of the “return” command to begin with.

In the example from the exercise:

def square_point(x_value, y_value):
  x_2 = x_value * x_value
  y_2 = y_value * y_value

Doesn’t this already assign (and store!) values to variables x_2 and y_2 as soon as the square_point function is called with concrete values of x and y?

What then is the added benefit of return x_2, y_2 in the third line of the function?

10 Likes