How to convert 007898989 to 7898989 in Python -
i trying convert 007898989 7898989 in python using following code:
long(007898989) however leads following error:
>>> long(007898989) file "<stdin>", line 1 long(007898989) ^ syntaxerror: invalid token how can convert number correctly?
indeed, doing this:
a = 007898989 will raise error syntaxerror: invalid token, easiest way convert long be:
on python 2
a = long("007898989") print trying cast on python 3 give nameerror: name 'long' not defined, so, i'd best solution below one
on python 2/3
a = int("007898989") print(a)
Comments
Post a Comment