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

CJ PHUA
CJ PHUA
6,729 Points

can't pass this question

what is the answer to this i type this

subject="treehouse loves + name"

strings.py
name="cj"
subject="treehouse loves + name"
treehouse loves CJ

1 Answer

In your second line, you have included name inside of the quotes. This will result in the word "name" being included in the string rather than using the value stored in the name variable on the first line.

To complete the challenge correctly, you need to close the quotes after the word "loves", then use a plus sign(+) and the variable called name.

name = "CJ"
subject = "Treehouse loves " + name

The output of this code would result in Treehouse loves CJ.