long()
function returns an expression(or value) converted into a long integer number.
long(value, base)
Here,
Note: If the value is float, the conversion truncates towards zero. And if the number is not a number
i.e if the base is given, then the number must be a string or Unicode object representing a literal base. The default base is 10. Values allowed are 0 and 2-36.
>>> long(0o10)
8
>>> long(0x10)
16
>>> long(0b10)
2
>>> long('0101', 2)
5L
>>> long('0101', 8)
65L
>>> long('0101', 16)
257L
>>> long('0101', 10)
101L
>>> long("3.15")
3L
>>> long(3.14)
3L
>>> long(3.14e10)
31400000000L
>>> long(-3.14)
-3L
>>> long('-100')
-100L
>>> long('+100')
100
>>> long('100')
100L