PythonFunction Return Value
Return Values
To let a function return a value, use thereturn
statement:
Example
def my_function(x):
return 5 * x
print(my_function(3))
print(my_function(5))
print(my_function(9))
Try it Yourself »return 5 * x
print(my_function(3))
print(my_function(5))
print(my_function(9))
Related Pages
Python Functions TutorialFunctionCall a FunctionFunction Arguments*argsKeyword Arguments**kwargsDefault Parameter ValuePassing a List as an ArgumentFunction Return ValueThe pass Statement i FunctionsFunction Recursion