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 (2015) Python Data Types String Formatting

What'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)

strings.py
name = "msmly"
subject = "Treehouse lovses {} ".format(name)

7 Answers

Tushar Singh
PLUS
Tushar Singh
Courses Plus Student 8,692 Points

Typo 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
PLUS
Tushar Singh
Courses Plus Student 8,692 Points

Work 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
Grigorij Schleifer
10,365 Points

Hi KHALED,

maybe the is a typo inside lovses. Change it to loves :)

Grigorij

Dears 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
PLUS
Tushar Singh
Courses Plus Student 8,692 Points

Question--->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)

I have modified as you said But the same error message

name = "msmly"
subject = "Treehouse lovse {}".format(name)
Tushar Singh
Tushar Singh
Courses Plus Student 8,692 Points

No you din't.

my code ------------------> "Treehouse loves

your code ------------------->"Treehouse lovse

Spelling mistake-- check out the word after treehouse

Thank you so much dear Tushar Singh,

A small mistake but destroyer