The return statement
Return a value to the caller.
return expression list
If an expression list is present, it is evaluated, else None is substituted.
return leaves the current function call with the expression list (or None) as return value.
In a generator function, the return statement is not allowed to include an expression list. In that context, a bare return indicates that the generator is done and will cause StopIteration to be raised.
return may only occur syntactically nested in a function definition (see def), not within a nested class definition.