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 trialJonathan Newman
247 PointsQuiz is Broken???
If you look at the code you will probably think right off, "oh he forgot his print" Well not only did I try that a couple thousand times, it also states in the instructions not to put print.
name = "Jonathan"
subject = ("Treehouse loves {}")
print(subject.format(name))
This works perfectly in the workbench but isn't accepted by the quiz with or without "print()"
name = "Jonathan"
subject = ("Treehouse loves {}")
subject.format(name)
2 Answers
Danny L.
10,837 PointsThat's so weird I don't know why it's not working in the challenge. You're right your code does produce the desired result in the shell...
In the meantime you could try this:
name = "Your Name"
subject = "Treehouse loves {}".format(name)
#you can also print if you like it
print (subject)
Jonathan Newman
247 PointsThat seemed to have worked, thank you! I'm new to this so if you could get a mod on that it is Python Basics: String Formatting. Thanks again.
Danny L.
10,837 PointsI'm new too! Happy to help :)