f-strings debugging shortcut
Instead of typing things, with it's value twice. With f-strings there is a nice shortcut.
Without f-strings:
1
number = 32
2
print(f"number={number}")
3
4
cards = {'R':4, 'J': 24}
5
print("cards", cards)
Copied!
With fstrings
1
print(f"{number = }")
2
# returns number = 32
3
print(f"{cards = }")
4
# returns cards {'R': 4, 'J': 24}
Copied!
Copy link