O'Reilly logo
  • James Knott thinks this is interesting:

String concatenation

Two strings can be joined using the + operator:

print "Only way to join" + "two strings"

The following is the output of the preceding code:

C:pydev>python string_concatenation.py
Only way to join two strings


Cover of Learn Python in 7 Days


Output is wrong. Will not add a space unless you tell it to