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 trialJUSTIN SNELLING
571 PointsWhen I execute this code in online sandbox it works, but is not working here. Any suggestions? Thanks
name = "Hi, my name is {}" print(name.format("Justin")) subject = "Treehouse loves {}" print(subject.format(name))
name = "Hi, my name is {}"
print(name.format("Justin"))
subject = "Treehouse loves {}"
print(subject.format(name))
2 Answers
Christopher Shaw
Python Web Development Techdegree Graduate 58,248 PointsThe challage does not ask you to print anything, so remove the 2 line with print doing this can give unexpected results.
Add the .format(name) to the line where you assigned the variable subject. Doing this in the print line is not assigning it to the vaiable subject.
Harry Clarkson
7,677 PointsHi While that does work, to complete the challenge change the last two lines into one line. Have a go, if you get stuck just comment on this and I'll post the code.
Harry
JUSTIN SNELLING
571 PointsThank you!