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 trialLee Charlton
5,615 PointsString Formatting
I have written this code into Workspaces and it has worked, however when I come to do the code challenge, it doesn't pass.
name = "lee"
subject = "treehouse loves {} "
print(subject.format(name))
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! While your code may be functional, it doesn't meet the explicit instructions of the challenge. Keep in mind that challenges have very specific requirements and it's always best to try not to do anything they don't ask for. For instance, you're trying to print something and it never asked for that.
Also, your string is incorrect. You've written "treehouse" instead of "Treehouse". The challenge is testing your output and it must be perfect to the letter. This includes capitalization, punctuation, and spacing.
The line you're looking for is:
subject = "Treehouse loves {}".format(name)
Hope this helps!
Lee Charlton
5,615 PointsLee Charlton
5,615 PointsAh thank you Jennifer! It makes perfect sense now.
I'll be sure to check my punctuation and capitalization in future and makes sure I stick to the question requirements.
Thanks for the fast response :)