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 trialor porat
684 Pointscant pass this question
its ask me to make a varible called "subject" = 'treehouse loves' and use the + key with my name varible. so i wrote: name = 'or' subject = 'treehouse loves' + 'or' were did i go wrong?
thanx!
name = 'or'
subject = "treehouse loves" + 'or'
3 Answers
AJ Longstreet
Treehouse Project Reviewername = 'or'
subject = "treehouse loves" + 'or'
Would result in "Treehouse lovesor"
name = 'or'
'treehouse loves ' + name
note the space after loves.
jacksonpranica
17,610 PointsBasically when you use the string concatenation, your code:
name = 'or'
subject = "treehouse loves" + 'or'
Will print out "treehouse lovesor"
You need an extra space at the end of "treehouse loves " <--- see how there's a space between the word loves and the " (quotation mark)?
This will help the sentence print out like "treehouse loves or" with a space between loves and the word or. Treehouse is telling you you are wrong as a way to make sure you make sure to add spaces so when you bring words together they have a space between them.
so the correct code is
name = 'or'
subject = "treehouse loves " + 'or'
OR YOU CAN USE
name = 'or'
subject = "treehouse loves " + name
or porat
684 Pointsthanx!!
or porat
684 Pointsor porat
684 Pointsi mean why i need extra spaces?