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

I tried my code on the workspace and it worked fine, but the same code placed here gets me a error

my code name = "bob" subject = "Treehouse loves {} " print(subject.format(name))

error message asks me to try and use {} and .format()

  • which I am already using and
  • this code works fine in the workspace
strings.py
name = "Ajay"
subject = "Treehouse loves {}"
print(subject.format(name))

1 Answer

Steven Parker
Steven Parker
231,269 Points

:point_right: Remember that "works fine" does not always mean "does the correct thing".

Your program may print just what you expect, but the challenge did not ask for anything to be printed.

See these hints I gave to someone who did nearly the exact same thing just a few minutes ago.

that worked! thank you