Return in python



what exactly does “return” do in a function? I kind of get what it does but not exactly. Sorry for the noob question; I just started coding


From StackOverflow:

The print() function writes, i.e., “prints”, a string in the console. The return statement causes your function to exit and hand back a value to its caller. The point of functions in general is to take in inputs and return something. The return statement is used when a function is ready to return a value to its caller.


Thank you! :grinning: