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

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.