Why does python add an 'L' on the end of the result of large exponents?

Python

I have just noticed that while executing large exponent codes, python adds an L letter to the very end of the results:

>>> 25 ** 2588817841970012523233890533447265625L

After researching, I discovered that any amount that is below 10 doesn't add the L letter. For example:

>>> 9 ** 9387420489 

 

Why does this happen, is there any function to stop it?

1
Answers

Replies

Python is flexible to provide its extensible support to the arbitrary precision integers , allowing you to represent the larger numbers than the general 32 or 64-bit integer type. The L will help you determine when a literal is of this type and not as a regular integer. L will be showing up in the interpreter output. If you print it in the below way, L will not get printed.


>>> print(25 ** 25)


88817841970012523233890533447265625

 
 

If you want to unleash your potential in this competitive field, please visit the Python course page for more information, where you can find the Python tutorials and Python frequently asked interview questions and answers as well.

 

This topic has been locked/unapproved. No replies allowed

Login to participate in this discussion.

Leave a reply

Before proceeding, please check your email for a verification link. If you did not receive the email, click here to request another.