Functions in Python — a practical guide to Python functions with clear examples you can reuse in real projects.
Python Tutorial Series (27/95). Prefer one article? Read the complete Python tutorial.
Short description
Functions reduce duplication and make programs modular. Prefer clear names and small responsibilities.
Define a function
def greet(name):
return f'Hello, {name}'
print(greet('Imtiyaj'))