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

concatenation. What am I doing wrong?

N/a

strings.py
name = 'dom'
subject = 'Treehouse loves'
print subject + name

2 Answers

Stephen Gheysens
Stephen Gheysens
11,935 Points

Hi Dominique, my guess is that the solution is looking for "Treehouse loves dom", but without a trailing space in your second variable assignment, the output would just be "Treehouse lovesdom". Let me know if this helps!

Well, sort of. First off, you shouldn't be printing anything.

Second, you should be concatenating string, but formatting strings :smile:

Actually, Treehouse is asking to format the name variable into subject and not to print it :smile:

To format a string, you can do this:

'Hello there {}'.format(name)

(This is just an example, the real solution you must find for yourself) :)

If this hint doesn't help much, please ask below for more hints and I'd be happy to help :smile:

~Alex