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 trial
Erin Clayton
3,874 PointsWhat am I doing wrong? favorite_color = "green" input("What is your ", favorite_color, "?") print input
I suspect it is a syntax error. I know it's super basic...but I'm a noob.
favorite_color = "green"
input("What is your ", favorite_color, "?")
print input
1 Answer
Travis Alstrand
Treehouse Project ReviewerSo there's a few minor adjustments needed here. We don't want to actually set a "favorite color" value. We want to prompt the user for it, in this odd case, the "user" is the back end of the site which will perform tests on your code.
So we should be storing whatever text the user replies with in that variable, which is going to come from the input() method. So we should make this the value of favorite_color like so:
favorite_color = input("What is your favorite color? ")
This will store whatever the user types into the prompt inside of the favorite_color variable for us to use later.
Lastly, we'll want to remove that print statement as adding in extra code that the challenge doesn't ask for can sometimes cause issues.
I will note that print is a method, so if you were going to want to print something, you need to wrap it in parentheses. So it would actually look like:
print(favorite_color)
I hope this makes sense and gets you through that task 👍