When an expression evaluates to a value, including when a function returns a value, there are three things that might happen to the value:
-- show it to the user (print)
-- use it as part of a more complex expression
-- save it for later use, either by assigning to a variable, or adding to a data structure like a list or a dictionary.
Print just shows things to the user. Return makes it available for one of the other two uses.
IIRC this is all set, though if we want to add other textbook things those could be issues too. Can open again if you think I'm incorrect here of course
When an expression evaluates to a value, including when a function returns a value, there are three things that might happen to the value: -- show it to the user (print) -- use it as part of a more complex expression -- save it for later use, either by assigning to a variable, or adding to a data structure like a list or a dictionary.
Print just shows things to the user. Return makes it available for one of the other two uses.