How convert string '1e7' to an integer?

Peng Yu pengyu.ut at gmail.com
Sun Nov 8 02:17:09 CET 2009


It seems that int() does not convert '1e7'. I'm wondering what
function to use to convert '1e7' to an integer?

>>> int('1e7')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '1e7'



More information about the Python-list mailing list