Beside casting it with str(), you can also use a format string:
assert "%d" % 10 == "10"
assert "%5d" % 10 == " 10"
assert "%05d" % 10 == "00010"
In practice % supports a superset of what printf in C provides.
Andreas
Am Freitag, den 21.03.2008, 17:05 -0700 schrieb elis aeris:
> how do I conv
>>> y = 3
>>> type(y)
>>> x = str(y)
>>> type(x)
On Fri, Mar 21, 2008 at 8:05 PM, elis aeris <[EMAIL PROTECTED]> wrote:
> how do I convert int to string?
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
how do I convert int to string?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor