Python Return Statement
Syntax
The return statement in Python is used to exit a function and optionally return a value to the caller.
def function_name(): # Code to execute return value
# Call functionfunction_name()Example
def say_hello(): return 'Hello World'
print(say_hello())# Output: Hello World