python vs ecmascript

Cliff Wells logiplexsoftware at earthlink.net
Fri Nov 16 19:02:48 EST 2001


On Friday 16 November 2001 14:03, Peoter Veliki wrote:

> I'm using Python 2.0 at the moment (it is necessary as it is integrated
> into another product), perhaps this limitation was removed in later
> versions.  If I try to do this:
>
> print "integer i = " + i
>
> it will barf on this and tell me that i is not a string, I must do this:
>
> print "integer i = " + str(i)

That's because you're _adding_ an integer to a string (not because you're 
printing an integer).  You can add two integers, or even two strings, but 
you can't mix and match.

-- 
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308




More information about the Python-list mailing list