Python Functions
Table of Contents
Python Functions
Reusable blocks of code that perform specific tasks.
Examples
Basic Function
def greet(): print("Hello, World!") greet() # Output: Hello, World!
Function with Parameters
def add_numbers(a, b): return a + b result = add_numbers(5, 3) print(result) # Output: 8