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

Python Python Basics Meet Python Using Input

Not 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

using_input.py
favorite_color = input("What is your favorite color? ")
favorite_color = "purple"
print("The color",  favorite_color, "is a great color!")

@Craig Dennis

4 Answers

Paisley Myers
Paisley Myers
209 Points

I think it will work if you take out the second line. You are defining favorite_color twice.

Craig Dennis
Craig Dennis
Treehouse Teacher

Yeah 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
Christian Berglönn
3,274 Points

As 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

props to Paisley Myers figured it out the red confused me because I put red for the other challenge before this one thanks guys