Python

Learn Python programming from scratch

144 tutorials
12 of 144 tutorials
Jul 10, 2026· 7 min read

Default Parameter Values in Python Functions

Learn how to set default values for function parameters, the rules for ordering required and optional parameters, and how to avoid mutable default value pitfalls.

FunctionsIntermediatePython
Jul 10, 2026· 7 min read

Python *args Explained

Learn how *args lets Python functions accept any number of positional arguments, how it works under the hood as a tuple, and when to use it in your own functions.

IntermediateFunctionsPython
Jul 10, 2026· 7 min read

Python **kwargs Explained

Learn how **kwargs lets Python functions accept any number of keyword arguments, how it works as a dictionary, and how to combine it with *args for maximum flexibility.

IntermediateFunctionsPython
Jul 10, 2026· 7 min read

Pass Objects to Python Functions

Understand how Python passes objects to functions, the difference between passing mutable and immutable types, and how to avoid accidental data modification.

FunctionsIntermediatePython
Jul 10, 2026· 7 min read

Pure Functions and Side Effects in Python

Learn the difference between pure functions and impure functions, why purity matters for testing and reliability, and how to write more pure functions in Python.

IntermediatePythonFunctions
Jul 10, 2026· 7 min read

Python lambda Functions Explained

Learn how lambda functions work in Python, when to use them for short anonymous operations, and when a regular named function is the better choice.

FunctionsPythonIntermediate
Jul 10, 2026· 7 min read

Recursive Functions in Python

Learn how recursive functions work in Python, including base cases, the call stack, recursion depth limits, and when to choose recursion over iteration.

IntermediatePythonFunctions
Jul 10, 2026· 7 min read

Nested Functions in Python

Learn how to define functions inside other functions in Python, why nesting is useful for encapsulation and factories, and how inner functions access outer variables.

PythonIntermediateFunctions
Jul 10, 2026· 7 min read

Closures in Python

Learn what closures are in Python, how they capture variables from enclosing scopes, and how to use them for function factories, callbacks, and state encapsulation.

FunctionsIntermediatePython
Jul 10, 2026· 7 min read

Function Annotations in Python

Learn how to annotate function parameters and return values in Python, what annotations are used for, and how they improve code readability and tooling support.

PythonFunctionsIntermediate
Jul 10, 2026· 7 min read

Document Python Functions with Docstrings

Learn how to write effective docstrings for Python functions, the PEP 257 conventions, and how tools like help() and Sphinx use them to generate documentation.

FunctionsIntermediatePython