You know about strings, and you know about arithmetic operators. Now let’s combine the two!

print "Life " + "of " + "Brian"

This will print out the phrase Life of Brian.

The + operator between strings will ‘add’ them together, one after the other. Notice that there are spaces inside the quotation marks after Life and of so that we can make the combined string look like 3 words.

Combining strings together like this is called concatenation. Let’s try concatenating a few strings together now!



Let’s give it a try. Print the concatenated strings "Spam ", "and ", "eggs" on line 3, just like the example above.

Make sure you include the spaces at the end of "Spam " and "and ".

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?