Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

Level Up Your Python Strings

May 4, 2026

If you're still using `.format()` or `%` for string interpolation in Python, it's time to fully embrace f-strings. They aren't just more readable; they're actually faster because they're evaluated at runtime rather than being constant strings that require a function call.

A little-known trick is the `=` specifier introduced in Python 3.8. Writing `f"{variable=}"` will output both the variable name and its value (e.g., `variable=10`). It’s the ultimate "quick and dirty" debugging tool when you don't want to fire up a full debugger.