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 trialEmma Collins-Opon
2,538 Pointswhat is wrong with the code name = "Emma" treehouse = "Tree" + "house" ......
name = "Emma" treehouse = "Tree" + "house" email_greeting = ({} "Loves" {}.format(name,treehouse))
name = "Emma"
treehouse = "Tree" + "house"
email_greeting = ({} "Loves" {}.format(name,treehouse))
2 Answers
Nathan Newell
7,634 Pointsname = "nathan"
treehouse = "Tree" + "house"
email_greeting = treehouse + " loves " + name
Michael Vandenburg
6,952 Pointsformat
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
2,538 PointsThanks again that was extremely helpful
Emma Collins-Opon
2,538 PointsEmma Collins-Opon
2,538 Pointsthank you