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

Mamadou Diene
seal-mask
.a{fill-rule:evenodd;}techdegree
Mamadou Diene
Python Web Development Techdegree Student 415 Points

I feel like i got the code written the right way, but for some reason its not passing

i feel like i ve answered the question, but its not passing

strings.py
name = "john"
subject = "treehouse loves {} ".format(name)

3 Answers

Steven Parker
Steven Parker
229,732 Points

The string you are formatting with seems to have an extra space at the end (after the placeholder). The challenges can be very picky about the contents of strings given in the instructions.

Janek Neumann
PLUS
Janek Neumann
Courses Plus Student 4,289 Points

Steven is correct here, just tried it for you.

name = "john" subject = "treehouse loves {}".format(name)

Steven Parker
Steven Parker
229,732 Points

You got a "best answer" for saying I was right? :laughing:

Steven Parker
Steven Parker
229,732 Points

Thanks! When discussing an existng answer and not providing an alternative, I like to use "add comment" instead of "add an answer" (as you did this time).