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

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

Consider below Python program.

 `# A Python program to demonstrate that we can store` `# large numbers in Python` `x ``=` `10000000000000000000000000000000000000000000` `x ``=` `x ``+` `1` `print` `(x)`

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.

 `# A Python program to show that there are two types in` `# Python 2.7 : int and long int` `# And in Python 3 there is only one type : int` `x ``=` `10` `print``(``type``(x))` `x ``=` `10000000000000000000000000000000000000000000` `print``(``type``(x))`

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 :

 `# Printing 100 raise to power 100` `print``(``100``*``*``100``)`

Last Updated on November 13, 2021 by admin

## Convert JSON to CSV in PythonConvert JSON to CSV in Python

Convert JSON to CSV in Python The full form of JSON is JavaScript Object Notation. It means that a script (executable) file which is made of text in a programming language, is used to store and transfer the data. Python supports

## Response Methods – Python requestsResponse Methods – Python requests

Response Methods – Python requests When one makes a request to a URI, it returns a response. This Response object in terms of python is returned by requests.method(), method being – get, post, put, etc. Response is a powerful object

## Draw Color Filled Shapes in Turtle – PythonDraw Color Filled Shapes in Turtle – Python

Draw Color Filled Shapes in Turtle – Python turtle is an inbuilt module in python. It provides drawing using a screen (cardboard) and turtle (pen). To draw something on the screen, we need to move the turtle. To move turtle, there

## Python – Using variable outside and inside the class and methodPython – Using variable outside and inside the class and method

Python | Using variable outside and inside the class and method In Python, we can define the variable outside the class, inside the class, and even inside the methods. Let’s see, how to use and access these variables throughout the

## Display the Pandas DataFrame in table styleDisplay the Pandas DataFrame in table style

Display the Pandas DataFrame in table style In this article, we’ll see how we can display a DataFrame in the form of a table with borders around rows and columns. It’s necessary to display the DataFrame in the form of

## Different ways to clear a list in PythonDifferent ways to clear a list in Python

Different ways to clear a list in Python   There are many ways of clearing the list through methods of different constructs offered by Python language. Let’s try to understand each of the method one by one. Method #1 :

## Python map() functionPython map() function

Python map() function returns a map object(which is an iterator) of the results after applying the given function to each item of a given iterable (list, tuple etc.) Syntax : map(fun, iter) Parameters : fun : It is a function

## Passing function as an argument in PythonPassing function as an argument in Python

Passing function as an argument in Python A function can take multiple arguments, these arguments can be objects, variables(of same or different data types) and functions. Python functions are first class objects. In the example below, a function is assigned to a