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

Emma Collins-Opon
Emma Collins-Opon
2,538 Points

what is wrong with the code name = "Emma" treehouse = "Tree" + "house" ......

name = "Emma" treehouse = "Tree" + "house" email_greeting = ({} "Loves" {}.format(name,treehouse))

name.py
name = "Emma"
treehouse = "Tree" + "house"
email_greeting = ({} "Loves" {}.format(name,treehouse))

2 Answers

Nathan Newell
Nathan Newell
7,634 Points
name = "nathan"
treehouse = "Tree" + "house"
email_greeting = treehouse + " loves " + name

format replaces the pairs of {} inside the string that called it, so you want to move your quotation marks to include the {} that you want it to sub in its arguments for.

Emma Collins-Opon
Emma Collins-Opon
2,538 Points

Thanks again that was extremely helpful