Python Python Basics (2015) Python Data Types String concatenation

Gerald Ford
Gerald Ford
2,079 Points

Make a new variable named subject that concatenates (+) the string "Treehouse loves" and your name variable

Not working for me

strings.py
name="ford"
subject="Treehouse loves{}".format(name)

3 Answers

behar
behar
10,434 Points

Hey Gerald, you solution would work aswell, but in this challenge, it actually wants you to use the '+' operator, so instead do:

subject="Treehouse loves " + name

Hope this helps!

Gerald Ford
Gerald Ford
2,079 Points

name="ford" subject="Treehouse loves"+ name It’s not working

behar
behar
10,434 Points

Hey again Gerald! Your still missing that space. With your code subject would be "Treehouse lovesford". But you want it to be "Treehouse loves ford". So put a space after your string.

Gerald Ford
Gerald Ford
2,079 Points

name="ford" subject="Treehouse loves" + name Not working for me

behar
behar
10,434 Points

Your doing:

subject="Treehouse loves" + name

When you should be doing:

subject="Treehouse loves " + name
behar
behar
10,434 Points

Glad to help, you can mark the question as "solved" by sellecting a "best answer".