Python Max Int

In Python 3 integers don’t have a maximum size. The largest possible list or in-memory sequence is going to be sys.maxsize. Python 2 had a sys.maxint constant with a value of 9223372036854775807, but that constant was removed in Python 3.

Also, if you need to use a number that’s larger/smaller than any other you can use float('inf') and float('-inf') respectively.

Leave a Reply