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 trialStuart McIntosh
Python Web Development Techdegree Graduate 22,874 Pointswhat is wrong with this code: name = "stuart" subject = "Treehouse Loves {}".format(name)
what is wrong with this code
name = "Stuart" subject = "Treehouse Loves {}".format(name)
name ="Stuart"
subject = "Treehouse Loves {}".format(name)
5 Answers
Gianmarco Mazzoran
22,076 PointsHi,
your code is ok.
I copy and paste it and pass the challenge!
What's the problem?
Stuart McIntosh
Python Web Development Techdegree Graduate 22,874 PointsI didnt pass the challenge - error must use format() and {}
Gianmarco Mazzoran
22,076 PointsTry to refresh the page and re-type the code!
Chloe Viriyapunt
1,300 PointsI'm frustrated. I have been refreshing and re-coding for about 5 times but I'm still having the same error! "error must use format() and {}.
name = "Chloe" subject = "Treehouse Loves {}" .format(name)
Gianmarco Mazzoran
22,076 PointsHi,
the code you have write here have space before .format(name)
.
Be sure that you don't have space between the string and the format function:
name = "Chloe"
subject = "Treehouse Loves {}".format(name)
Chloe Viriyapunt
1,300 PointsThank you Gianmarco.
Gianmarco Mazzoran
22,076 PointsGlad that I help you!
John Hofford
6,990 PointsI think one of the code recommendations should be to "refresh your browser". I had a similar issue above and refreshed mine once and used the same code and it finally passed. After a dozen tries..