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

Wesam Asiri
Wesam Asiri
3,859 Points

name=" Wesam Asiri" subject="treehouse loves{}" print(subject.format(name))

why it doesn't work?

strings.py
name=" Wesam Asiri"
subject="treehouse loves {}"
print(subject.format(name))

2 Answers

Only two minor errors:

  • The challenge never asked you to print anything out.
  • You should do .format() directly on the string. It is possible to do this in different ways, but sadly the code challenges are very picky :expressionless:
  • Finally, you used a lowercase "t" in "treehouse", when the challenge is expecting an uppercase "T". Even this counts as an error!

I hope this helps :grin:

Happy coding! :tada:

:point_right: If you continue to fail, please post your new code snippet and I'll try to point out the error.

:dizzy: ~Alex :dizzy:

Wesam Asiri
Wesam Asiri
3,859 Points

thanks for your help

No problem :smile:

Can you please provide a best answer? Thanks to you! ~Alex