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 trialChristopher Gomez
Courses Plus Student 13,800 PointsNot sure what I'm doing wrong
Bummer: : Hmm...I answered the prompt with 'Red' but that's not what was in the variable favorite_color
I keep getting this error and I redid the challenge before this one but still get the same error message
favorite_color = input("What is your favorite color? ")
favorite_color = "purple"
print("The color", favorite_color, "is a great color!")
4 Answers
Paisley Myers
209 PointsI think it will work if you take out the second line. You are defining favorite_color twice.
Christopher Gomez
Courses Plus Student 13,800 PointsCraig Dennis
Treehouse TeacherYeah don't re-define the color to purple...I call your script and fill in the prompt...that sets favorite_color
to what I entered.
That make sense?
Christian Berglönn
3,274 PointsAs Paisley says, you're already letting the user define favorite_color with your input statement. By defining favorite_color again with "purple" probably just messes it up. Try removing favorite_color = "purple" and it probably will work.
Cheers
Christopher Gomez
Courses Plus Student 13,800 Pointsprops to Paisley Myers figured it out the red confused me because I put red for the other challenge before this one thanks guys
Christopher Gomez
Courses Plus Student 13,800 PointsChristopher Gomez
Courses Plus Student 13,800 Points@Craig Dennis