Python guides
Every published Python guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Python guides
Most readLatest Python guides
Page 131 of 179Python Recursion: How It Works and When to Use It
Understand how recursion works in Python, including the call stack, recursion limits, common pitfalls, memoization, and when iteration is a better choice.
Python Recursive Function: A Practical Guide
Learn how a Python recursive function works, when to use recursion, and how to avoid stack overflow and performance pitfalls.
Python Return Type Hints: Syntax and Usage
Learn how to declare return type hints in Python, handle optional and union returns, and use typing constructs for cleaner, more maintainable code.
Python Parameter Type Hints: Syntax and Runtime Behavior
Understand Python parameter type hints: syntax, runtime behavior, and how they improve code maintainability and static analysis.
Python Function Annotations: Syntax and Practical Use
Learn how Python function annotations work, what they do at runtime, and how to use them with type checkers and frameworks like FastAPI.
Passing a Dictionary to a Python Function: Syntax and Behavior
Learn how passing a dictionary to a Python function works, including reference vs copy semantics, **kwargs expansion, and avoiding mutable default pitfalls.
Python Pass List to Function: Behavior and Pitfalls
Learn how Python passes lists to functions, why in-place changes affect the caller, and how to avoid mutable default arguments.
Python Argument Unpacking: *args and **kwargs
Learn how Python argument unpacking works with *args and **kwargs, including sequence and mapping unpacking, function definitions, common errors, and performance trade-offs.
Python Args Kwargs Together: Syntax and Usage
Learn how to combine *args and **kwargs in Python function definitions, including ordering rules, unpacking, and practical examples.
Python args kwargs difference: *args vs **kwargs
python args kwargs difference: Learn how *args and **kwargs differ in Python: *args collects positional arguments into a tuple, **kwargs collects keyword arguments int...