Return Statement

In Python, the function is optionally return the value.
A return statement in the function, ends the execution part and return the value to the caller.

Example:

def add(a, b):
    return a + b	# Returns the sum of a and b
total = add(5,10)	# Calling add function with 2 arguments and receive the total as 15.


Related Tutorials