Python Function
Syntax
A function in Python can be defined using the def keyword, followed by the function name, parentheses, and a block of code.
def function_name(): # Code to execute
# Call functionfunction_name()Example
def greet(): print("Hello World")
greet()
# Output: Hello World