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

kind of confused on this one

Could someone help. Im a little confused on this one

strings.py
name = "Treehouse loves {}"
print(name.format("Deja Vu"))

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

Hi CJ,

You are close but probably overthought this one. For the "name" variable you only need a string of your name. For the subject, you create another variable with the string "Treehouse loves {}" with .format(name) on the end. The {} is a placeholder for whatever variable you pass through with .format(). In this case, you are passing in your name. Here is what the code looks like:

name = "Chris"

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

Hope this helps.

Chris

thank you so much

1 Answer

i did the same thing, but the question is a little different, u don't need to print out, just start with subject = ,and from here it should be easy already, it's just one line, 2 with the previous question