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 trialLinh Tran
177 Pointshow to use .format() to put name into the placeholder?
how to use .format() to put name into the placeholder?
subject="Treehouse loves "
name="Linh"
print ("Treehouse loves {}",format("Linh"))
1 Answer
Jennifer Nordell
Treehouse TeacherYou're soooo close here! First, it doesn't want you to print that string. It wants it reassigned to subject. I'm quite sure you've gotten emails from Treehouse by now with the subject line: "Treehouse loves Linh", right? That's what we're going for here.
Secondly, before the format that should be a period not a comma. Third, we can use the name variable you set up earlier to put "Linh" into the brackets. Take a look:
subject = "Treehouse loves {}".format(name)
Our subject variable will now have a value of "Treehouse love Linh". Just like the emails you get from Treehouse. Hope this helps!
Linh Tran
177 PointsLinh Tran
177 Pointsmy code finally can run now. thanks a lot, Jennifer :)
Irina Azcona
941 PointsIrina Azcona
941 PointsAh thanks so much. I was suck in this problem.