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 trialsteve lehocky
1,064 Pointshow is this not right? not sure what it is specifically asking me to do first?
so how isnt this what they want here name = 'steve' subject = 'treehouse loves {}'.format(name)) print(subject)
name='steve'
subject="treehouse loves {}"
print(subject.format(name))
2 Answers
andren
28,558 PointsThe instructions tell you to format the string and store the result in the subject
variable, and that is all the task wants you to do. Like this:
name='steve'
subject="Treehouse loves {}".format(name)
They do not ask you to print it out. You should also note that I changed the string slightly, you had forgotten to capitalize the T in Treehouse. These challenges are very picky about strings, so even a minor typo like that is enough to make your code be marked as invalid.
Nilay Jain
4,146 PointsHello Steve, Below code should work. The challenge has two parts- On the first type- name = "steve" and on the next just add the below line- subject = "Treehouse loves {}".format(name)
steve lehocky
1,064 Pointssteve lehocky
1,064 Pointsthank you andren, unfortunately i did try this a few times exactly how you have it and copied/ pasted yours in and it still didnt work, so i wonder if i should refresh. this is why it was so frustrating and yeah i added print after the third time writing it too.
andren
28,558 Pointsandren
28,558 PointsThat's weird I verified that the code I pasted passed the challenge before I posted so it should definitively work if you copy it, but the challenges can indeed be pretty buggy at times.
steve lehocky
1,064 Pointssteve lehocky
1,064 PointsYeah it finally worked. I thought I was going crazy. Again, thank you guys for helping so quickly. I'm really trying to dive into code and I'm really fascinated with it. I'm sure I'll be posting more with questions in other tests. If you can give any advice on what to do after python, of things I should add to my learning, that would be great. I'm Interested in it all, but wish to have a solid foundation of the most common programs in an appropriate order.