I am looking for minimum and maximum values for integers in python. For eg., in Java, we have Integer.MIN_VALUE and Integer.MAX_VALUE. Is there something like this in python?
Python 3 does not have a maximum size of int. The plain int type is unbounded in Python 3.
But you can check machines word size( Word size is a fixed-sized piece of data handled as a unit by the instruction set or the hardware of the processor). That is available in Python 3 which can be seen by running the following code.
But in Python 2, the maximum and minimum value for plain int values is available which can be seen by the following code.
import sysmax= sys.maxintmin= -sys.maxint -1 print(max) print(min)
min= -sys.maxint -1
Python seamlessly switches from plain too long integers once you exceed this value. So most of the time, you won't need to know it.
To know more about this you can have a look at the following video tutorial:-