Let’s see what are min and max values of integer in Python. We will assume we are working on 64-bit version of Python.
Using maxsize method
There is a sys module which will help us to answer above questions. MAxsize method will tell us the max value of integer in Python.
import sys print(sys.maxsize)
It turns max integer is exactly 9223372036854775807 which is 2^63-1.
However to show min value you need to use one of below:
import sys minSize = -sys.maxsize - 1 print(minSize)
import sys minSize = ~sys.maxsize print(minSize)
Min value of integer is -9223372036854775808.