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

Python basic question poorly worded.

The question is poorly worded and doest sufficiently describe the task.

strings.py

3 Answers

Nathan Tallack
Nathan Tallack
22,160 Points

As best as I can remember when I first faced it:

Task 1 of 2*

I want to make the email subject one more time, but this time let's use the .format() method for strings. Go ahead and make your name variable again. Hey, all practice is good practice, right?

Simple enough here.

name = "John Smith"

Task 2 of 2*

OK, so now use .format() on the string "Treehouse loves {}" to put your name into the placeholder. Assign this to the variable subject again.

The tricky part here is the "assign this to the variable subject again". The context is missing here. Makes it hard to understand. But I ended up working it out as this.

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

It is the context problem. If they worded it with more internal consistency it might be a little easier to undrstand. Perhaps something like this.

Now create a variable named subject and assign it the string "Treehouse loves {}" using the .format() method to insert your name from the variable you created in the previous step.

See, stands consistent alone.

Anyhow, keep up the great work! It really is worth it, honestly. I am loving where treehouse has gotten me! :)

Christopher Shaw
seal-mask
PLUS
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Shaw
Python Web Development Techdegree Graduate 58,248 Points

The first task is asking you to create a variable called 'name' again, exactly as you did in the previous challenge.

The second task is asking you to create a variable 'subject' and to use the format() to put your name into the subject line provided.

Nathan Tallack
Nathan Tallack
22,160 Points

I remember doing this challenge. It was a little convoluted for such an introductory level challenge. I must admit I remember finding it a little overwhelming.

here is the questions: " I want to make the email subject one more time, but this time let's use the .format() method for strings. Go ahead and make your name variable again. Hey, all practice is good practice, right?"

Here is what I initially came up with (which fails):

name = "kim" subject = "{}".method("Treehouse loves ")

How does the question as it is worded ask for more?