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

Pravin Patel
PLUS
Pravin Patel
Courses Plus Student 440 Points

Assistance needed on strings

Not sure what am doing wrong, but the question ask...

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

This is what i have thus far

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

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

4 Answers

Haider Ali
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Haider Ali
Python Development Techdegree Graduate 24,728 Points

Hey Pravin, I can safely say that the technical side of your code is correct. The mistake is that the 'Loves' shouldn't have a capital letter since these challenges do tend to be very strict:

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

If you have any further questions, please leave a comment :)

Thanks,

Haider

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Pravin,

Your code is correct. The error you are receiving is because challenges are very picky and very strict when it comes to entering what it wants. So, you just have a minor typo (or Capitalization issue). The word "loves" in the string needs a lower-case "l" and you have it upper-cased. Just fix that up and you're good to go.

Keep Coding!

:dizzy:

Kourosh Raeen
Kourosh Raeen
23,733 Points

Hi Pravin - The grading system is just being picky about you using capital L in Love. Just change that to love and it will pass.

Pravin Patel
PLUS
Pravin Patel
Courses Plus Student 440 Points

Thank You; I practiced this and was working but not exact to the system.

So far the experience on going through the material is good, the exercises are excellent, my teach Kenneth Love makes it simple and easy to understand. My concern is putting variables, functions together that can be challenging because not sure when to use them or how to use them. Its coming together slowly but again its how, when, what putting them together is my concern. What would you guys suggest?

Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Practice, repetition, and more practice. The more you do, the more sense it makes. However, for myself personally, Python and I don't really get along. I'm more of a PHP or Rails person. Everyone is different, so it's just a matter of finding your passion and your niche. :-)