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 trialChesed Private
Courses Plus Student 70 Pointsconcatenates?
what's the answer
name = "Michelle"
subject = ("Treehouse loves" + {name})
1 Answer
andren
28,558 PointsThere are three issues:
You aren't supposed to wrap variable names in curly braces {}.
When you concatenate strings they are merged without any spacing added. So
"Treehouse loves" + name
results in"Treehouse lovesMichelle"
. In order to get a properly spaced string you have to add a space manually.You don't need to use parenthesis () when you assign a value.
If you fix those three issues like this:
name = "Michelle"
subject = "Treehouse loves " + name
Then your code will work.
Jason Anders
Treehouse Moderator 145,860 PointsJason Anders
Treehouse Moderator 145,860 PointsSubsequent Questions (x2) regarding this thread have been deleted. Please do not post repeat questions regarding the same topic / challenge. Continue any subsequent follow-ups within the same thread as originally started. Multiple threads clutter the Community and cause confusion among others.
Thank-you
Jason ~Treehouse Community Moderator