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 trialKHALED MSMLY
345 PointsWhat's wrong with my answer? !!!
Challenge Task 2 of 2
OK, so now use .format() on the string "Treehouse loves {}" to put your name into the placeholder. Assign this to the variable subject again.
name = "msmly" subject = "Treehouse lovses {} ".format(name)
name = "msmly"
subject = "Treehouse lovses {} ".format(name)
7 Answers
Tushar Singh
Courses Plus Student 8,692 PointsTypo error. You wrote treehouse lovses.It should be loves Second thing you have an additional white space after your brackets.It should be like this.
subject = "Treehouse loves {}".format(name)
Tushar Singh
Courses Plus Student 8,692 PointsWork on it, if there's again a problem, then just paste my code underneath your code and check word to word. The error is "loves".
name = "msmly"
subject = "Treehouse loves {}".format(name)
Grigorij Schleifer
10,365 PointsHi KHALED,
maybe the is a typo inside lovses. Change it to loves :)
Grigorij
KHALED MSMLY
345 PointsDears Grigorij Schleifer, Tushar Singh,
I've done everything suggested by you,
name = "msmly"
subject = "Treehouse lovse {}".format(name)
but sill I get the error message:
Bummer! Be sure to use the {}
placeholder and the .format()
method.
I am going crazy
Tushar Singh
Courses Plus Student 8,692 PointsQuestion--->OK, so now use .format() on the string "Treehouse loves {}" to put your name into the placeholder. Assign this to the variable subject again.
"Treehouse loves
typo error again.
your code says "lovse"
It should be "loves"
Everything is fine just replace "lovse" to "loves"
name = "msmly"
subject = "Treehouse loves {}".format(name)
KHALED MSMLY
345 PointsI have modified as you said But the same error message
name = "msmly"
subject = "Treehouse lovse {}".format(name)
Tushar Singh
Courses Plus Student 8,692 PointsNo you din't.
my code ------------------> "Treehouse loves
your code ------------------->"Treehouse lovse
Spelling mistake-- check out the word after treehouse
KHALED MSMLY
345 PointsThank you so much dear Tushar Singh,
A small mistake but destroyer