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 trialNosin Ibna Mahbub
572 Pointshow to use .formate() method
I can't complete my task
name="MOON"
subject="Treehouse loves {}.formate(name)"
1 Answer
Ben Reynolds
35,170 Points- There's a typo, "formate" should be "format"
- The format method gets added at the end of the string, after the closing quote mark. Right now you have the whole thing enclosed in quotes so it's treating the format code like plain text.
Oliver Small
12,578 PointsOliver Small
12,578 PointsI think you may be spelling it wrong, it should be .format(name). You also need to close the " before you use it. so it would be
subject = "Treehouse loves {}".format(name)