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

I need help of string, specifically challenge Task 3 of 3. I did the

How do you write the code to putout "X" loves "Y". I have tried writing the code several times but it not working.

name.py
name="Michael"
treehouse=("Tree"+"house")
email_greeting=output("Michael" + "love"+ "Tree" +"house")

2 Answers

name = 'Kristich'

treehouse = "Tree" + "house"

email_greeting = "{} loves {}".format(treehouse, name)

this should solve your problem

It did not work.. I did just as you showed but it did not work..

Clint Walton
Clint Walton
146 Points

This was a tough one for me and it took a few tries but got it to work. It gives a hint to not forget your spaces.

name = 'Clint'

treehouse = "Tree" + "house"

email_greeting = "{} loves {}".format (treehouse, name)

@Kevin Donaldson just copy my code and paste it...it definately should work because i just tested it in the code challenge now