Python long type

long type value

Python can handle really large integers. A long integer is written just like an ordinary integer but with an L at the end.


print 1000000000000000000L 
print 123123123123123123123L * 123123123123123123123L + 23 

The code above generates the following result.

The following code uses long in calculation.


def c( p ) :# from  w  w  w . j a va2  s . c o m
       spy = 60 * 60 * 24 * 365.2422
       n = long ( spy ) * long ( p )
       return n

n = c ( 186000 )
print n

The code above generates the following result.





















Home »
  Python »
    Data Types »




Data Types
String
String Format
Tuple
List
Set
Dictionary