Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Python Data Types String Formatting

Grayson Jones
Grayson Jones
550 Points

What?

Not sure where to go from here.

I was certain that if I assigned the string 'Treehouse Loves {}'

To a variable (Ex: the variable will be hello) I would do. print(hello.format(name))

Where am I going wrong here?

strings.py
name = 'Grayson'
subject = 'Treehouse Loves {}'
print(subject.format(name))

1 Answer

Jon Wood
Jon Wood
9,884 Points

I reviewed the challenge and it seems that you don't need to print :). Just remove the last line and add the .format to the second string and it should be good to go!

Grayson Jones
Grayson Jones
550 Points

Jon Wood, Ha! More like. Jon's a big help man.

Jon Wood
Jon Wood
9,884 Points

Heh! Glad to help! :)