Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (2015) Python Data Types String concatenation

Rashed Molawizadeh
Rashed Molawizadeh
185 Points

I can't get past this

OK! Make a new variable named subject that concatenates (uses the + sign) the string "Treehouse loves" and your name variable. You've probably received an email or two with this subject already!

strings.py
name = ("Rashed") 
subject = ("Treehouse loves" )
Treehouse loves  + name
Afloarei Andrei
Afloarei Andrei
5,163 Points

'''name = "Rashed" subject = "Treehouse loves " + name '''

Raduica Sebastian
Raduica Sebastian
Courses Plus Student 1,356 Points

name="Rashed" subject="Treehouse loves" result=name+subject

2 Answers

Manish Giri
Manish Giri
16,266 Points

This is wrong -

subject = ("Treehouse loves" )
Treehouse loves  + name
  1. You first create the strings - "Treehouse loves " + name
  2. Then you assign the whole thing to subject - subject = "Treehouse loves " + name

You're almost there!

So what the challenge is asking you to do it, create a new variable and add together a string and another variable.

To fix your code you just need to remove the third line and use this for the second line:

subject = "Treehouse loves " + name

When you then call the variable, subject, you'll get the output: Treehouse loves ... replace ... with the name you put in the name variable

Hope this helps! Happy coding :)