6. String debug
When debugging with f-strings, use the built-in debug format to be more concise.
The debug form is particularly handy in quick diagnostics because the label stays tied to the expression automatically. That means you can rename variables or change expressions without rewriting the surrounding string.
6.1. Don’t do this
1x = 35
2y = 88
3
4print(f'x = {x}, y = {y}')
5print(f'x * y = {x * y}')
6.2. Do this
1x = 35
2y = 88
3
4print(f'{x = }, {y = }')
5print(f'{x * y = }')