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

Hi below formula is not working when trying to add my (name) back into the (subject) brackets. Says Bummer, Make sure us

Bummer: make sure to use {} and .format()

Here's my formula that keeps getting BUMMER:

name = "Erik" subject = "Treehouse loves {}" print(subject.format(name))

It works on Workspace though. Thanks, Erik

strings.py
name = "Erik"
subject = "Treehouse hates {}"

2 Answers

Steven Parker
Steven Parker
231,248 Points

:point_right: Your code may "work", but it's not what the challenge asked for.

The challenge says: use .format() on the string "Treehouse loves {}". It's expecting you to apply the format function directly to the string, but you assigned the string to a variable and used format on the variable.

It also says: Assign this to the variable subject again. So you need to make that assignment instead of using print.

Thanks, figures it out name = "Erik" subject = "Treehouse now loves {}".format(name))