python vs ecmascript

Brian Quinlan brian at sweetapp.com
Fri Nov 16 18:32:50 EST 2001


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

This not a limitation of print, it is a consequence of Python's strong
typing (I'm sure others will jump in to tell you why that is a good thing).
The syntax that you are looking for is:

print "integer i =", i





More information about the Python-list mailing list