atoi

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Wed Apr 24 08:24:39 EDT 2002


----- Original Message -----
From: "Mariappan, MaharajanX" <m_mariappanX at trillium.com>


> 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

Python 2.1.2 (#31, Jan 15 2002, 17:28:11) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> int("234")
234

Is that what you're looking for?

The float() function works similarly but returns a floating-point value.

Chris Gonnerman -- chris.gonnerman at newcenturycomputers.net
http://newcenturycomputers.net







More information about the Python-list mailing list