String adding.

Stephen Kloder stephenk at cc.gatech.edu
Tue Oct 17 22:23:27 EDT 2000


Mark Cunningham wrote:

> i know doing:
>
> strName = 'wow'
>  '<' + strName + '>'
>
> will give you  <wow>
>
> but what about:
>
> intName = 3
> print '<' + intName + '>'
> this gives me some illegal argument type for built-in operation..
> how would i make it give me <3>????

>>> intName=3
>>> print '<' + `intName` + '>'    # (Those are back-ticks, not quotes)
<3>

BTW `x` is the same as repr(x)

--
Stephen Kloder               |   "I say what it occurs to me to say.
stephenk at cc.gatech.edu       |      More I cannot say."
Phone 404-874-6584           |   -- The Man in the Shack
ICQ #65153895                |            be :- think.





More information about the Python-list mailing list