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

Did not understand what to do?

When I run in the workspace the code is working.

strings.py
name = "Can"

subject = "Treehouse loves {}."

subject.format(name)

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Can,

While your code is syntactically correct and will produce the correct output, it is not what the challenge is asking for. Instructions are very specific in Treehouse challenges and must be followed exactly, or the task will result in the Bummer!.
Here the instruction explicitly state to:

use .format() on the string "Treehouse loves {}"

But you are using the format() method on the variable storing the string and not on the string itself. If you just delete your last line of code and do the format() right on the string, the task will pass.

It's a good thing to remember how picky and specific instruction are for future challenges!

Other than that... Nice work! :)

:dizzy: