This article is part 4 of 6 in the series Python Classes Tutorial

Concatenating strings basically just means to add a number of strings together to form one longer string. It can be done easily in Python using the '+' symbol.

Let's say you had three strings:

"I am", "Learning", "Python"

To concatenate these, simply add them together using the '+' symbol, like this:

>>> print "I am" + "Learning" + "Python"

Your output should be: "I am Learning Python".

You can also concatenate strings within variables, like this:

string1 = "I am"
 string2 = "Learning"
 string3 = "Python"
 >>> print string1 + string 3

In this case your output would be "I am Python".

About The Author