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

Ryan Lucas
Ryan Lucas
6,946 Points

String formatting test in python broken? Hi, I am trying to do this simple task, but i keep getting error messages

I get error messages when I ask to check my work. However when I run my code in the python shell it runs, with no errors and how it should. This is my code

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

It executes fine in the shell, but when i ask the treehouse website to check it, I keep getting errors to include the '{}' and '()' which I have done so. ???

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

2 Answers

Tobias Helmrich
Tobias Helmrich
31,603 Points

Hey Ryan,

to me everything in your code looks correct but you may try to write "loves" instead of "Loves", so replace the uppercase L with a lowercase l as this could possibly cause the error.

Ryan Lucas
Ryan Lucas
6,946 Points

I can't believe that worked. It passes now, thanks!