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 trialAshton Hatchett
326 PointsI am not sure what I am doing wrong? subject="Treehouse loves{}" .format(name)
It worked in workspace
name="Ashton"
subject="Treehouse loves {}." .format(name)
2 Answers
reanimator313
6,005 PointsThe string must be exactly the same as the challenge
"Treehouse loves {}"
Kenneth Love
Treehouse Guest TeacherYou have a space between the end of your string and the dot for the format
method. Take that out. Extra spaces like that will cause things to not work.
reanimator313
6,005 PointsI tried this challenge with this code and it passed
name="Ashton"
subject="Treehouse loves {}" .format(name)
And with this code did not pass
name="Ashton"
subject="Treehouse loves {}.".format(name)
Bummer! Be sure to use the {}
placeholder and the .format()
method.
Why?
Kenneth Love
Treehouse Guest TeacherIt was because of the period inside the quotes. I've changed it now, though, so the period shouldn't matter.