
Python Tip: Improve Readability Using Underscores in Numbers
π Python Tip:
When working with large numbers, Python lets you use underscores (_) to enhance readability.
Here is an example: π
β # Difficult to read:
gigabit = 1000000000
ten_gigabit = 10000000000
β
# Easier to read with underscores (_):
gigabit = 1_000_000_000
ten_gigabit = 10_000_000_000
print(f"{gigabit=}\n{ten_gigabit=