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

im confused

ive watched the video a good 3 times now im having trouble

strings.py
name = "name"
name.format("name")
"treehouse loves {}".format("name")
subject = "treehouse loves {}"
Dennis Le
Dennis Le
12,872 Points

Hey Brent, What are you confused about? Maybe I can assist you?

2 Answers

Two things;

One, they are really strict about the capitalization on this one for some reason so the 't' in Treehouse should be capitalized. And two, the 'subject' variable should be equal to the string with the .format() at the end like so:

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

yeah the capital is really stupid

Julian Garcia
Julian Garcia
18,380 Points

As a thumb rule, at least for me, in treehouse if they indicate you to put an specific text just copy it and paste it inside your code where is required.

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