VOOZH about

URL: https://www.geeksforgeeks.org/python/what-is-the-maximum-possible-value-of-an-integer-in-python/

⇱ What is the maximum possible value of an integer in Python ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

What is the maximum possible value of an integer in Python ?

Last Updated : 23 Jul, 2025

Consider below Python program.
 

Output : 

10000000000000000000000000000000000000000001


In Python, value of an integer is not restricted by the number of bits and can expand to the limit of the available memory (Sources : this and this). Thus we never need any special arrangement for storing large numbers (Imagine doing above arithmetic in C/C++).
As a side note, in Python 3, there is only one type "int" for all type of integers. In Python 2.7. there are two separate types "int" (which is 32 bit) and "long int" that is same as "int" of Python 3.x, i.e., can store arbitrarily large numbers.
 

Output in Python 2.7 : 
 

<type 'int'>
<type 'long'>


Output in Python 3 : 
 

<type 'int'>
<type 'int'>


We may want to try more interesting programs like below : 
 


 

Comment
Article Tags:
Article Tags: