On 28-May-12 19:00, Jeremy Duenas wrote:
and the both printed the same output……so why would I want to use ‘+’ to
add strings if there seems to be no reason too?

Juxtaposing strings only works with constants, which may be convenient
in some cases, but it won't work at all when concatenating other string values.

a="hello"
b="world"

a+b    # will yield "helloworld" but
a b    # is a syntax error

Using + is arguably preferable when you have a choice to make, since it works in all cases, including constants.

--
Steve Willoughby / st...@alchemy.com
"A ship in harbor is safe, but that is not what ships are built for."
PGP Fingerprint 4615 3CCE 0F29 AE6C 8FF4 CA01 73FE 997A 765D 696C
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to