Blog

Dive into Python, clean code practices, and real-world development tips.

*args and **kwargs: Flexible Function Arguments

By Jeferson Peter • Sep 4, 2025 Python

Python lets you pass a variable number of arguments to functions using `*args` (positional) and `**kwargs` (keyword).

Invert a Dictionary with Comprehension

By Jeferson Peter • Sep 2, 2025 Python

With a single line of dictionary comprehension, you can flip keys and values in Python.

set(): Remove Duplicates Easily

By Jeferson Peter • Aug 31, 2025 Python

A quick way to remove duplicates from a list in Python is to convert it into a `set`.

Slice Trick `[::-1]`: Reverse Lists and Strings

By Jeferson Peter • Aug 30, 2025 Python

With slicing syntax, you can reverse sequences in one line — no loops or extra functions needed.

any() and all(): Quick Logical Checks

By Jeferson Peter • Aug 28, 2025 Python

Two built-in functions that let you check conditions across a whole iterable in one line, instead of writing loops.

zip(): Pairing Lists Together

By Jeferson Peter • Aug 26, 2025 Python

The built-in `zip()` function lets you combine multiple iterables element by element — and with `*` you can “unzip” them back.

`enumerate()`: Index + Value in One Go

By Jeferson Peter • Aug 24, 2025 Python

Instead of manually tracking counters in loops, `enumerate()` gives you both index and value in a single, clean expression.

The Many Faces of the Underscore (`_`) in Python

By Jeferson Peter • Aug 22, 2025 Python

The underscore is more than a throwaway symbol. It has multiple meanings in Python, from ignoring values to naming conventions.

Walrus Operator (`:=`): Assignment in Expressions

By Jeferson Peter • Aug 20, 2025 Python

A newer Python feature (since 3.8) that lets you assign values inside expressions, reducing repetition and making code more compact.

List Comprehension: Compact List Building

By Jeferson Peter • Aug 17, 2025 Python

A short and expressive way to create and transform lists, keeping the code readable and simple.