FAQ: Introduction to Functions - Multiple Return Values

I was also a little bit confused by that. Actually, I suppose that what made it more difficult for me to fully clarify the multiple return values context at the specific exersice with boundaries, was the repeating use of the words “low” and “high” in the code.
To keep its simplier and more clear , I tried to use letters. At least for me, this way quite helpful .The output was of course the same. For example:

def get_boundaries(target, margin):
L = target - margin
H = target + margin
return L, H

A,B = get_boundaries(100, 20)

#we added this print statement just to sanity-check our solution:
print("Low limit: “+str(A)+”, High limit: "+str(B))

In fact, by “A” I name the first call of the function which corresponds to the first return value “L” i.e. the first calculation (subtraction).
By “B” I name the second call of the function which corresponds to the second return value “H” i.e. the second calculation (addition).

im having all kinds of issues with this one and im not sure why I get any where from a syntax error to errors I don’t quite understand I write the first part as follows def get_boundaries(target, margin): and it still wont progress past the first steps. I have also enter the low_point information as well as the high_point can someone please help me makes some sense of this error

If you would show your code (if you do so, please use the </> icon from the menu bar to preserve the indentations and render your code as readable Python), it would be so much easier to try to make sense of the error.

1 Like