conversion of INTEGER into string

Erik Max Francis max at alcyone.com
Mon Apr 14 05:13:05 EDT 2003


Chris wrote:

> I want to convert an integer, e.g. 2000 into a string (i.e. "2000")
> As far as I know, the chr() funktion only works with integers  in the
> range of -256 to + 256
> 
> So, what is the right method ??

You want the str function/type:

>>> str(2000)
'2000'

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Bachelors have consciences, married men have wives.
\__/ H.L. Mencken
    WebVal / http://www.alcyone.com/pyos/webval/
 URL scanner, maintainer, and validator in Python.




More information about the Python-list mailing list