Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Level Up Your Python Debugging with F-Strings
February 15, 2026
Most Python devs know about f-strings for basic formatting, but did you know they have a built-in shortcut for debugging? Instead of writing `print(f"user_id = {user_id}")`, you can simply write `print(f"{user_id=}")`. This automatically prints the variable name followed by its value.
It saves a few keystrokes and makes those quick "sanity check" print statements much faster to write and easier to read in the console output. It even works with expressions, so you can do `print(f"{len(users)=}")` to quickly see the count without any extra boilerplate.