atoi

Martijn Faassen m.faassen at vet.uu.nl
Wed Apr 24 15:27:24 EDT 2002


Mariappan, MaharajanX <m_mariappanX at trillium.com> wrote:
> Hi all,

> simple......but need to know

> is there any python buildin method whihc will convert strings into integer,
> like atoi in c lib.?

> "234" should be converted into interger value 234

> but the string function ord(character) convert it into equvalent ASCII code

Try the builtin 'int()' (no need to import anything).

so:

foo = int('10')

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list