0

I was working with python and I tried to see what is the largest number a variable in python can hold. Interestingly, I found that I kept on increasing that number and there was no end limit. Is there any max number limit in Python? My code is

import sys
a = sys.maxsize
for i in range(200):
   a *=sys.maxsize
print(a)

and the answer was a 10,12 lines integer.

Ahmad Anis
  • 1,587
  • 2
  • 14
  • 40

1 Answers1

0

Integers in Python can be arbitrarly large. There are lots on articles about how that is handled internally, like https://www.codementor.io/@arpitbhayani/how-python-implements-super-long-integers-12icwon5vk.

Michael H.
  • 2,925
  • 2
  • 19
  • 29