String Concatenation


#1

Can someone tell me the different between

  1. print "Spam " + "and " + "eggs "

and

  1. print "Spam " "and " "eggs "

Why i need +


#2

you need the + to concatenate strings, how else does python know it needs concatenate strings?


#3

The + sign tells python to add, or put, the strings together.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.