Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Python Data Types String Formatting

why isnt this code working? name = "mark" subject = "Treehouse loves {}".format(name)

i dont understand why this code isnt working? it says i havent used the placeholders {} and .format() correctly but i dont see any other way to use them? there should really be a corrected version to stop one faffing about for hours on end and actually accommodate the process of learning. becoming very frustrating.

strings.py
name = "mark"
subject = "Treehouse loves {}".format(name) 
Johannes Scribante
Johannes Scribante
19,175 Points

Hi Mark,

What error are you getting? This seemed to work when I tried your code.

4 Answers

Hi Mark,

I have noticed that for whatever reason sometimes you need to close out your browser take a minute and then reopen the browser and complete the challenge. Your code for this challenge IS correct and should pass. Please let us know here if you were able to complete the challenge. So that this can show resolved and others can move on....

feel free to ask more if needed....

Thank you! and happy coding!!!

Oh my gosh!! I'm so utterly relieved to come back and read these replies!! Thank you!! After repetitively attempting at the time I almost went crazy and took a step off for a while. Given your timely responses however, it appears that wasn't necessary. It could still be a good idea, in the meantime, to show and explain a corrected example on the challenger after several failed user inputs. This will allow the student to keep momentum when learning whilst saving your time answering queries. In either case, your prompt response to queries is great! Thanks!

Oh my gosh!! I'm so utterly relieved to come back and read these replies!! Thank you!! After repetitively attempting at the time I almost went crazy and took a step off for a while. Given your timely responses however, it appears that wasn't necessary. It could still be a good idea, in the meantime, to show and explain a corrected example on the challenger after several failed user inputs. This will allow the student to keep momentum when learning whilst saving your time answering queries. In either case, your prompt response to queries is great! Thanks!

I think they designed it that way so that we learn to work together to solve problems. It's all about collaboration.