Functions
Functions
A function is a reusable block of code designed to perform a specific task.
Built-in Functions: Ready-to-use functions built directly into Python (like print(), len(), and max()).
User-Defined Functions: Custom functions created using the def keyword.
Parameters & Arguments: Parameters are the variables listed inside the function definition, while arguments are the actual values you pass into the function when you call it.
Docstring: A short text description placed at the top of a function inside triple quotes (""") to explain what it does.
Scope: Where a variable can be accessed. Local variables only exist inside a function, while global variables can be accessed anywhere.