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:-
Certification in Digital Marketing |
Certification in Big Data Analytics |
Certification in Cloud & Devops |
Certification in Full Stack Web Development
Big Data and Data Science Master’s Course |
Data Science Architect Master’s Program |
Cloud and DevOps Architect Master’s Course |
Artificial Intelligence Engineer Master’s Course |
Microsoft Azure Certification Master’s Training
Data Science Course Online |
Big Data Hadoop Certification Training |
Machine Learning Course Online |
Artificial Intelligence Course and Training |
Salesforce Certification Training: Administrator and App Builder |
Tableau Training and Certification Course |
Python Data Science Course & Training |
Ethical Hacking Course |
Business Analyst Course |
Courses in Cyber Security
© COPYRIGHT 2011-2021 INTELLIPAAT.COM. ALL RIGHTS RESERVED.
Download Salary Trends Now !
Learn how professionals like you got up to 100% Salary Hike.