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

I'm writing the code correctly, I have tried using it in python directly and it works. It's not allowing me to pass.

I'm writing the code correctly, I have tried using it in python directly and it works. It's not allowing me to pass.

Something doesn't seem to be working correctly...

strings.py
name="Sebastian"
subject="Treehouse loves {}"
print(subject.format(name))

1 Answer

Hey there, Sebastian!

The challenge wants you to append your name to the subject string, not print it to the screen. Your code will absolutely work, but it doesn't meet the challenge's requirements.

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

Your code should look similar to the above since it wants you to use the .format() method when you declare the variable.

Hope this helps. :-)

Yes, I have solved the issue and found other threads, I hadn't entered the forum yet. I will do from now on, thanks!