PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchUse a single underscore between digits to make a long Python integer literal easier to read: population = 1_234_567_890. Python ignores the separators when it determines the value, so this has the same value as 1234567890. Underscores in source code and separators added to displayed output are separate features.
How underscores work in Python number literals
Underscores are visual separators in a numeric literal, not arithmetic operators or part of a special number type. For example, 100_000_000_000, 100000000000, and 1_00_00_00_00_000 all represent the same integer. The Python 3.14.8 Language Reference documents the syntax and notes that it has been supported since Python 3.6 (Numeric literals).
Where to put underscores
For decimal integer literals, put one underscore between digits. Python does not require groups of exactly three digits; choose groupings that make the value easiest to interpret in context. Thousands-style grouping is familiar for decimal values:
population = 1_234_567_890
budget_cents = 25_000_000
Other bases support separators too. Use the explicit prefixes 0b for binary, 0o for octal, and 0x for hexadecimal. Group binary digits by meaningful bit patterns, or hexadecimal digits into bytes or words when that suits the value:
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
mask = 0b_1111_0000
permissions = 0o_755
address = 0xCAFE_F00D
An underscore may appear immediately after a base prefix, as in 0x_1f. PEP 515, which introduced this readability feature in Python 3.6, describes grouping decimal values by thousands and splitting binary or hexadecimal values into meaningful parts (PEP 515).
Which underscore placements are invalid?
The separator must follow the literal’s grammar; it cannot be placed arbitrarily.
Rank #2
_123is invalid as an integer literal because the underscore comes before the first digit.321_is invalid because the underscore trails the digits.123__321is invalid because the underscores are doubled.0_x1fand0x__1fare invalid; the valid prefixed example is0x_1f.0123is invalid as a nonzero decimal integer literal with a leading zero. Use an explicit base prefix when you mean binary, octal, or hexadecimal.
A sign is not part of the literal itself: in -1, Python applies the unary minus operator to the literal 1.
How to add separators when displaying a number
Underscores in source code make a literal easier to inspect, but they do not automatically change how a value is printed. To format an integer with grouped digits, use the format mini-language’s underscore option:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →large_value = 1_234_567
print(f'{large_value:_}') # 1_234_567
In the Python 3.14.8 format specification, decimal integer and floating-point presentation types group digits in threes; binary, octal, and hexadecimal integer presentation types group digits in fours. The locale-aware n presentation type is a separate formatting choice. See the Format Specification Mini-Language documentation.
When this feature is useful
Use separators when they make a literal’s magnitude or structure clearer to someone reading the code. For a decimal count, conventional thousands grouping is often easy to scan. For bit masks and hexadecimal constants, group around meaningful bit, byte, or word boundaries. These are readability conventions, not required group sizes; PEP 515 introduced the syntax to support that flexibility.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




