FAQ: Learn Python: Syntax - Concatenation

This community-built FAQ covers the “Concatenation” exercise from the lesson “Learn Python: Syntax”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Computer Science
Data Science

FAQs on the exercise Concatenation

In the context of this exercise, how does string concatenation work?

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

The term ‘argument’ here is not defined? What’s an argument in the context of Python?


An argument is simply a value provided to a function when you call it. Once you learn functions, I would search videos that talk about parameters and arguments (becoming comfortable with these terms earlier will help later). It will make more sense when you learn functions.

Essentially, just like the examples states : “we can pass a variable as an argument to…”
So string1 is an argument in this lesson.

Also questions that have to do definitions are really easy to find online. There are a lot of great resources!


I understand Concatenation but I don’t see any strings to connect in this question. What am I supposed to connect together? When I click ‘solution’ nothing appears.
Thanks in advance


Here’s how I see the exercise from my end:

We need to define message which is the concatenation of all those strings together and then print it.

And here’s the solution that worked for me:

I hope this helps.


I had a fun time concatenating the strings pythonically using the following code:

message = “”

for item in range(6): message += eval(“string” + str(item + 1))


1 Like

i made this but it won’t check the box even tho the message is displayed in the terminal on the right ? am i missing something ( this is for step 1 )

this is the exact message (string) i came up with and the same result but it won’t let me proceed … EDIT i had full_message but you have to use just message or the stupid thing won’t work…smh

Hi all :slight_smile:

So there’s two ways to print a concatenated string with a number in it:

  1. Make the number a string first with the str() function, then print(it + with + other + stuff)
  2. Don’t do 1, just print(it, inside, this, function)

What’s the reason behind these two methods? Why use 1) and not 2) ?


should be more simple?

Concatenation: does it automatically wrap to the display length? Seemed to in this exercise, but I don’t know if that’s a function of how the lesson system works or Python

When I did this exercise I tried writing the concatenation out without str(age) for the integer and it seems to still work. Is there a reason that I must write “str()” with the number? Are there certain instances where this would make a big difference? My work below:

birthday_string=“I am "
birthday_string2=” years old"



this time instead of doing it the traditional way, i tried to be a bit more creative and wrote:

message = full text

why did not it work