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

traolach trewhella
PLUS
traolach trewhella
Courses Plus Student 835 Points

okay i put everthing the right way didint work does someone have both answers clearly im doing my best with this answer

help

strings.py
name = "trey"

1 Answer

Kevin Faust
Kevin Faust
15,353 Points

you only posted the first part of the challenge. but i will explain how the second part works. You have to create another string saying "Treehouse loves " + the name variable. We do this by passing in {} and then use .format() to format the string with your variable. it looks something like this:

name = "trey"

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

let me know if you dont understand something