[Tutor] What does L at last stands for when 10 ** 30

Dave Angel d at davea.name
Fri May 4 16:16:28 CEST 2012

On 05/04/2012 09:57 AM, Santosh Kumar wrote:
> I am doing:
>>>> power = 10 ** 30
>>>> power
> and the output:
>>>> 10000...L          # what does L represent
> interesting thing is L doesn't shows when I do a: print power
> _______________________________________________

The L stands for "long".  The value is too large for an int, so it's
promoted to long (in python 3, no such distinction).

As for why it's printed, that's because in the debugger, it's displaying
the repr() of the result of your expression, while print displays the
str() of the result.

To see a similar effect, try a literal string in the debugger --  it
displays the quote marks, which are not part of the string, but they are
part of the repr(esentation).

-- DaveA

More information about the Tutor mailing list