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

Alexandre Gagarochkine
Alexandre Gagarochkine
426 Points

Make a new variable named subject that concatenates (uses the + sign) the string "Treehouse loves" and your name variab

Make a new variable named subject that concatenates (uses the + sign) the string "Treehouse loves" and your name variable. my answer : name = "Alex" subject = "Treehouse Loves " + name

But somethink wrong.I dont now why?

strings.py
name = "Alex"
subject = "Treehouse  loves " + name 

6 Answers

Stuart Wright
Stuart Wright
41,119 Points

The challenges can be picky. It doesn't like your double space between Treehouse and loves.

Alexandre Gagarochkine
Alexandre Gagarochkine
426 Points

name = "Alex"

subject = "Treehouse loves " + name

I did but still same result

Steven Parker
Steven Parker
231,007 Points

Odd, if I paste that into the challenge it passes.

Steven Parker
Steven Parker
231,007 Points

Just to be sure...

Here's the same thing you wrote yourself, but this time properly quoted to make sure Markdown isn't concealing something funny:

strings.py
name = "Alex"
subject = "Treehouse loves " + name 

I can assure you that it passes the challenge.

Alexandre Gagarochkine
Alexandre Gagarochkine
426 Points

Yes i did.Thanks.But coding was same i was writing what happen? pls explane me Thanks

Steven Parker
Steven Parker
231,007 Points

It looked the same to me also, but perhaps there was some funny character in there that Markdown was not showing. Otherwise, I have no idea!

Alexandre Gagarochkine
Alexandre Gagarochkine
426 Points

format() on the string "Treehouse loves {}" to put your name into the placeholder. Assign this to the variable subject (so start with subject =). my answer:

name = "Alex" subject = "treehouse loves {}" .format (name)

But nt working Sombody have ideya why? Thanks

Steven Parker
Steven Parker
231,007 Points

This challenge is specifically about concatenation (using the "+" sign). What you've done here would be functionally equivalent in practice, but it's not what the instructions asked for here and won't pass the challenge.

I'm still suspecting that odd character codes are involved. Did you try cut-and-paste directly from the box in my first answer ?