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 trialVishaun Prasad
Courses Plus Student 227 Pointssubject = "Treehouse loves, name" name has been defined has "Shaun" a string variable how do I do this properly?
I've defined name = "Shaun" subject = "Treehouse loves + name" subject = "Treehouse loves" + name
neither of these work
name = "Shaun"
subject = "Treehouse loves, name"
3 Answers
Jennifer Nordell
Treehouse TeacherIt wants you to use string concatenation. It doesn't understand in this context (without interpolation which comes later) that the name in your string is referencing your variable. So it's going to print out very literally what's inside those quots character for character. The challenge wants you to use concatenation, so take a look at how we do this.
name = "Shaun"
subject = "Treehouse loves " + name
Here we assign the variable subject "Treehouse loves " and then tack the name string onto the end. Note the trailing space after "Treehouse loves ". If we don't include this, our resulting string will be "Treehouse lovesShaun". So make sure to include the space otherwise the challenge will fail. Hope this helps!
Vishaun Prasad
Courses Plus Student 227 PointsI got it, and did it but I get an error
Oops! It looks like Task 1 is no longer passing.
Then it gives me some other weird error,
Vishaun Prasad
Courses Plus Student 227 PointsDone figured it out thank you so much =)