newbie question: converting integer to string

Ignacio Vazquez-Abrams ignacio at openservices.net
Sat Sep 22 13:12:46 EDT 2001


On Sat, 22 Sep 2001 adina_levin at mindspring.com wrote:

> 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?

`num`

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>





More information about the Python-list mailing list