Unable to understand the use of "return"


#1

hey guys,i've seen the 'return' keyword several times but i don't see any output of it or it making any changes to the program.can anyone highlight it's features?
thanks in advance :slight_smile:


#2

A return statement is used to exit a function, and send a value back to where the function was called from.

Some examples:

From StackOverflow:

From Learn Python the Hard Way:
http://learnpythonthehardway.org/book/ex21.html

From the Python docs:
https://docs.python.org/2/reference/simple_stmts.html#the-return-statement


13/18