Is this a BUG?

D-Man dsh8290 at rit.edu
Thu Dec 28 08:00:04 EST 2000


On Thu, Dec 28, 2000 at 10:48:14AM +0100, QdlatY wrote:
> print "!",form["index"].value,"!"
> ! 1 !
> ----------------
>  ^ ^
> Why the hell there are spaces? index property has value '1'!
> not ' 1 '?!

This is a result of print trying to be convenient for you.  If I write

print "abc" , "def"

I will get

abc def

as output.

If I write

print "abc" + "def"

I will get

abcdef


If you use string concatenation when you print you will only get what
you have (no spaces added) plus an EOL at the end.

> 
> Yours
> QdlatY


-D




More information about the Python-list mailing list