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 trialDarren Taylor
1,052 PointsCan someone please help me, I'm trying to write "Treehouse loves" '+' followed by my name variable.
Can someone please help me, I'm trying to write "Treehouse loves" '+' followed by my name variable.
The challenge Task reads:
"OK! Make a new variable named subject that concatenates (uses the + sign) the string "Treehouse loves" and your name variable."
name = "Darren"
subject = "Treehouse loves" '+' "Darren"
2 Answers
Kenneth Love
Treehouse Guest TeacherYou don't need the quotes around the +
, you need to just use it, like you would if you were adding two numbers together.
You should also use the name
variable instead of re-typing your name. Again, no quotes, just the name of the variable, which is name
Darren Taylor
1,052 PointsThanks for your help, I just remembered that I needed to put a space between the quotation mark after the word "loves."
Darren Taylor
1,052 PointsDarren Taylor
1,052 PointsThanks for your feedback, I've tried what you told me to do such as:
But my string is still coming up as incorrect, can you please give me an example. thanks
Kenneth Love
Treehouse Guest TeacherKenneth Love
Treehouse Guest TeacherWhen you concatenate (combine) two strings, Python doesn't add any extra spaces or anything, so right now your code makes
"Treehouse lovesDarren"
. How would you fix that?