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

Brian Healy
Brian Healy
485 Points

How do you concatenate 2 strings?

name = 'Brian' subject = "Treehouse_loves + 'name'"

strings.py
name = 'Brian'
subject = 'Treehouse_loves 
'subject' + 'name'

1 Answer

Thomas Fildes
Thomas Fildes
22,687 Points

Hi Brian,

Please see the below code I used to pass this challenge:

name = "Tom"

subject = "Treehouse loves " + name

Since "name" is a variable, you don't need to nest it inside quotation marks as you need to display the stored value in your "name" variable. Once you do this, the "subject" variable will equal "Treehouse loves Brian"

Hope this helps! Happy Coding!!!