How convert string '1e7' to an integer?

Christian Heimes lists at cheimes.de
Sat Nov 7 20:55:08 EST 2009


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

1e7 is a way to express a float in science and math. Try float("1e7")

Christian




More information about the Python-list mailing list