Re: [Tutor] int to string

2008-03-22 Thread Andreas Kostyrka
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

Re: [Tutor] int to string

2008-03-21 Thread Tom Tucker
>>> 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 >

[Tutor] int to string

2008-03-21 Thread elis aeris
how do I convert int to string? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor