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 trial

Python Python Basics (2015) Python Data Types String concatenation

challenge task 2 of 2 strings. Having trouble concatenating strings. Need help

having trouble concatenating strings, named variables and then tried to +, not working.

strings.py
name = 'neil'

2 Answers

Steven Parker
Steven Parker
231,236 Points

Well, you've got the right idea — string concatenation is done with the plus-sign (+) operator. Did you remember to assign your concatenated string to "subject"?

subject = "Treehouse Loves " + name

I figured it out this way, and it said I was correct. I am going to try your way, seems quicker and easier. Thank you very much.

name = 'neil' last_name = 'Treehouse_loves' subject = last_name + name