Forcing type conversion

Dale Strickland-Clark dale at out-think.NOSPAMco.uk
Wed May 17 10:36:27 EDT 2000


Whoa - enough!

Thanks everyone.

That was so fast, I'm considering throwing away all my other Python docs! :)

--
Dale Strickland-Clark
Out-Think Ltd, UK
Business Technology Consultants

Remco Gerlich <scarblac-spamtrap at pino.selwerd.nl> wrote in message
news:slrn8i5b34.6dp.scarblac-spamtrap at flits104-37.flits.rug.nl...
> Dale Strickland-Clark wrote in comp.lang.python:
> > How do I get Python to force 'a' and 'b' into strings so that the
following
> > concatenates instead of trying to add.
> >
> > a = 1
> > b = 2
> > a + ":" + b
>
> The str() function.
>
> a = 1
> b = 2
> str(a) + ":" + str(b)
>
> Or use the % operator, of course.
>
> --
> Remco Gerlich,  scarblac at pino.selwerd.nl
>
>    This is no way to be
>      Man ought to be free      -- Ted Bundy
>        That man should be me





More information about the Python-list mailing list