How to recast integer to a string
larry.bates at websafe.com
Tue May 9 21:42:14 CEST 2006
> How to recast an integer to a string?
> something like
> n = 5
> str = str + char(n)
1) Never use 'str' as a variable name as it will
shadow the built in str function. If you do, this
WILL jump up and bite you.
2) Either s=str(n) or s="%i" % n will return string
containing '5' (without the quotes of course).
Note: chr(n) would return character whose ASCII decimal
value is 5 (ASCII ENQ).
More information about the Python-list