Browse by Topic

Popular

Latest

Latest Python Posts

Technical illustration of a Python function call showing arguments being bound to parameters and a return value flowing back out.
Python

Python Function Call: Syntax, Binding, and Behavior

How Python evaluates a function call: argument evaluation order, binding, defaults, return values, callable objects, and call overhead.

function callsargument bindingcallable objectspython syntax
Illustration of Python function definition with def keyword and code blocks.
Python

Python def Keyword: Defining Functions

Learn how Python's def keyword defines functions, handles parameters, return values, scope, and decorators, with practical code examples.

PythonFunction definitionPython syntaxDecorators
Illustration of Python function declaration showing def keyword and parameters.
Python

Python Function Declaration: Syntax and Parameters

Learn the syntax for declaring functions in Python, including parameters, return values, default arguments, *args/**kwargs, and type hints.

python functionsfunction syntaxparameterstype hints
Diagram showing a nested tuple structure being unpacked into separate variables in Python
Python

Python Nested Unpacking: Syntax and Patterns

python nested unpacking: Learn how to unpack nested tuples, lists, and dictionaries in Python, handle variable-length data with star expressions, and avoid common pitf...

unpackingtuple unpackingdestructuringpython syntax
Illustration of two variables exchanging values using Python tuple unpacking, with a clean and modern design.
Python

How to Swap Variables in Python Using Tuple Unpacking

Learn how to swap variables in Python using tuple unpacking, why the evaluation order matters, and how to avoid common mistakes.

tuple unpackingvariable swapmultiple assignmentPython syntax
Illustration of Python double-star unpacking passing a dictionary into a function's keyword arguments
Python

Python **kwargs Unpacking: Syntax, Usage, and Pitfalls

Learn how Python's **kwargs unpacking works in function definitions and calls, with practical examples and common mistakes to avoid.

pythonkwargsfunction argumentsdict unpacking
Diagram showing how *args collects multiple positional arguments into a tuple and how * unpacks a list into separate arguments.
Python

Python *args Unpacking: Syntax and Common Pitfalls

python *args unpacking: Learn how *args packs extra positional arguments and how * unpacks iterables into function calls, with practical examples and pitfalls.

pythonargsfunction argumentsunpacking
Illustration of Python starred expression unpacking a list into multiple variables and function arguments.
Python

Python Starred Expression: Unpacking and Expansion

python starred expression: Learn how Python starred expressions work in assignments, function calls, and definitions, with practical examples and common pitfalls.

Pythonunpacking*args**kwargs
Illustration of Python extended unpacking showing values being distributed from a list into multiple variables and function arguments.
Python

Python Extended Unpacking: Syntax and Practical Uses

Understand Python's extended unpacking syntax for assignments, function calls, and iterable handling, with practical examples and common pitfalls.

unpackingstar-expressionsargskwargs
Illustration of Python iterable unpacking showing multiple variables being assigned from a single list or tuple.
Python

Python Iterable Unpacking: Syntax and Pitfalls

Learn how Python iterable unpacking works: basic assignment, starred expressions, loops, function calls, dictionaries, and common pitfalls.

PythonIterablesTuple UnpackingStarred Expressions