FAQ: Introduction to Strings - Concatenating Strings

This community-built FAQ covers the “Concatenating Strings” exercise from the lesson “Introduction to Strings”.

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

Computer Science

FAQs on the exercise Concatenating Strings

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!


Could someone explain why in this excercise, this code does not work as the solution?

def account_generator(first_name, last_name):
  new_account = first_name[:3] + last_name[:3]
  return new_account

According to this exercise solution, I first have to create a variable within the function called “account_name” and then outside the function equate “new_account” to the function in order to get the correct answer.

Hello :slight_smile:

Well, your function is correct and it should be accepted as the solution of the first step of instructions.

But in order to finish this exercise, you have to create a new variable new_account and assign to it the result of calling your function with arguments "Julie" (first_name) and "Blevins" (last_name).

If the instruction is not clear feel free to use Get Code Solution option that you will find under Get Help button (right bottom corner). If the solution code does not make sense - get back to us, we will try to help :slight_smile: