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 trialsatish kumar sannapaneni
Courses Plus Student 207 PointsString formatting
HI, I NEED HELP IN MOVING FORWARD ON THIS TASK.
name = "satish kumar"
subject = "Treehouse loves {}" + name
subject = subject.format(name)
1 Answer
Jaxon Gonzales
3,562 PointsHi Satish!
To format a string you can use the .format() method. The problem with your code is that you are trying to format and concatenate (use the '+' operator) the string. I'm not sure about the instructions to this code challenge but I think it would go something like this:
name = "Jaxon"
subject = "Treehouse loves {}".format(name)
# Subject is now equal to "Treehouse loves Jaxon"
Next time I would suggest also putting the instructions given to the code challenge. If this helps click the up arrow!
<Thanks, > <Jaxon>