How avoid both a newline and a space between 2 print commands?

Mike Kent mrmakent at cox.net
Wed Jan 23 16:13:35 CET 2008


On Jan 23, 9:03 am, "seber... at spawar.navy.mil"
<seber... at spawar.navy.mil> wrote:
> print "foo"
> print "bar"
>
> has a newline in between "foo" and "bar"
>
> print "foo",
> print "bar"
>
> has a space in between "foo" and "bar"
>
> How prevent ANYTHING from going in between "foo" and "bar" ??
>
> (Without defining a string variable.)
>
> Chris

print "%s%s" % ("foo", "bar")  ## If "%s%s" doesn't violate your
condition of not defining a string variable, I'm not sure.



More information about the Python-list mailing list