New to Codeacademy so I do apologize if this is on the wrong part of the forum.
I think I somewhat understand the return line of code in the functions exercise but, can someone clarify it in Barney terms what exactly that does ? Return is just the end product of the finished function once it has completed it’s steps ? This is someone coming from a zero experience background in this field. Sorry if this was not exactly clear.
Think of a simple meat grinder. We put chuck steak (for example) in the top, add a little downward pressure with the wooden utensil for that purpose, hand crank for a few revolutions and out the spout comes ground chuck.
The argument is the steak; the function the grinding; and, the return is the ground meat.
to cite the earlier example. We feed in a value for n, how many numbers we want in the list, range() returns a range object with that many data points, and list() converts that object to a list which is given back to the caller.
Also note that caller scope and function scope are not the same. The argument goes down into the function and the return comes back up to the caller.