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 (Retired) Ins & Outs Ins & Outs

0 1111111
0 1111111
Courses Plus Student 677 Points

3. email_greeting = "{} loves {}" .format(name,treehouse) and: email_greeting = "{}loves{}".format(name,treehouse) why

In response to question 3: Finally, create a new variable named email_greeting that puts the treehouse variable and thename variable into the sentence "X loves Y" but with treehouse for X and name for Y. Don't forget your spacing!

I have typed: name = "jack" treehouse = "Tree" + "house" email_greeting = "{} loves {}" .format(name,treehouse)

and also

name = "jack" treehouse = "Tree" + "house" email_greeting = "{}loves{}".format(name,treehouse)

but, I get a warning telling me that the answers are incorrect. why?

name = "jack"
treehouse = "Tree" + "house"
email_greeting = name

2 Answers

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Your attempt of email_greeting = "{}loves{}".format(name,treehouse) is really close. You need to swap name and treehouse around and you need spaces around the word "loves".

Hi Juan,

treehouse will substitute for X, and name will substitue for Y.

"X loves Y" but with treehouse for X and name for Y

Kind Regards