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

Joseph Ferrero
Joseph Ferrero
1,308 Points

Code Challenge Bug

Hello,

They are asking me to create a variable that equals my name, OK:

name = "joseph"

Then they want me to create another variable that says "Treehouse Loves {}", and then using .format(), inject the name variable. OK:

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

I know this is correct, but it keeps telling me that I got it wrong.

strings.py
name = "joseph"
subject = "Treehouse Loves {}".format(name)

4 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Joseph,

Yes, your code is correct in syntax, but challenges are very picky and specific with what it checks for. Here, it's simply just a typo. You capitalized the "L" in loves, when it should be lower cased.

Fix that up and all's good! :)

Keep Coding! :dizzy:

andren
andren
28,558 Points

Your code is correct but these challenges are extremely picky about how you write your strings, the string usually has to match the one they are looking for exactly, any difference no matter how minor tends to throw the challenge checker off.

In this case the issue is that you have capitalized the L in the word loves. If you write in in lower case like this:

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

Then your code will pass.

Joseph Ferrero
Joseph Ferrero
1,308 Points

Oh gosh that is rather picky, frustrated I didn't catch that.

Thanks so much.

Regards, Joseph