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

Pamela Zazueta
Pamela Zazueta
3,582 Points

What am I doing wrong?

What's missing?

strings.py
name = "Pamela"
subject = "Treehouse loves {}".format(Pamela, 
Dennis Witnauer
Dennis Witnauer
12,336 Points

You are very close. In the parentheses, you place the variable, not the literal value - for example - .format(name)

Hope this helps.

1 Answer

Umesh Ravji
Umesh Ravji
42,386 Points

Hi Pamela, there's something missing and something that shouldn't be there :)

In the first step you created the variable name and assigned to it the value Pamela.

In the secound step you have to use that name variable inside the format method, not hard code your name in there. The comma at the end shouldn't be there, instead the closing bracket for the format method call should be there.

name = 'Pamela'
subject = "Treehouse loves {}".format(name)