newbie question: converting integer to string

adina_levin at mindspring.com adina_levin at mindspring.com
Sat Sep 22 19:23:41 CEST 2001


nevermind

str(num)

<adina_levin at mindspring.com> wrote in message
news:9oifr8$and$1 at slb5.atl.mindspring.net...
> I would like to convert a variable, which represents an integer, to a
> string.
>
> To convert an integer to a string, one simply encloses the string in
quotes.
>
> e.g.
> >>> '42'
> '42'
>
> But how do you do this if the integer is represented by a variable?
>
> >>> num=42
>
> how can I generate a string representation of num?
>
> Thank you very much,
>
> - Adina
>
>
>





More information about the Python-list mailing list