September 2026
1051 pages
35h 4m
English
For working with integers, there is the int data type in Python. Unlike many other programming languages, this data type is not subject to any principal limits in its value range, which makes dealing with large integers in Python very convenient.[ 36 ]
We've already done a lot of work with integers, so using int doesn't really need any more demonstration. Nevertheless, for the sake of completeness, here is a small example:
>>> i = 1234>>> i1234>>> p = int(5678)>>> p5678
Since the release of Python 3.6, an underscore can be used to group the digits of a literal:
>>> 1_000_0001000000>>> 1_0_0100
Grouping doesn’t change the numerical value of the literal, but it serves to increase the readability of numerical literals. Whether ...
Read now
Unlock full access