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 trialNadia Balogou
212 PointsI keep getting an error message saying that I need extra spaces when using + but not sure how to format it
I am supposed to concatenate 'treehouse loves' + 'name'
name = 'Nadia'
subject = 'treehouse loves' + 'name'
4 Answers
Martin Smith
Courses Plus Student 467 PointsFirst issue is don't put quotes around name, thats a variable and you don't need quotes around it. Secondly add a space between loves and the ending quotation '.
What that does is instead of outputting:
treehouse lovesNadia
which your code currently does.
it'll output:
treehouse loves Nadia
Robert Lyon
7,551 PointsTry adding a space to the string. subject = 'Treehouse loves ' + 'name'
Nadia Balogou
212 PointsHi, I have tried adding spaces in different places but still running into the error message unfortunately.
Robert Lyon
7,551 PointsJust noticed you have quotes around the variable name aswell try removing those. subject = 'Treehouse loves ' + name