Return Statement
Last Updated: 01th September 2025
A return statement in Python is used to return a value from a function. It allows you to exit a function and return a value to the caller.
📝 Syntax:
def function_name():
# function body
#..
#..
return value
#When Call it
function_name()
def function_name(parameter1, parameter2):
# function body
#..
#..
return value
#When Call it
function_name(argument1, argument2)
Example 1.
def pi():
return 3.14159
print(pi()) # Output: 3.14159
Example 2.
def add(a, b):
return a + b
result = add(5, 3)
print(result) # Output: 8