Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Meet Python Using Input

Bummer: SyntaxError: invalid syntax Challenge Task 2 or 2 feeling REALLY dumb over here.

I thought if the text turned "green" I was on the right track?? This is just not sticking. I wrote everything down and I'm reviewing my notes. Is it normal to get stuck on a task like this for an hour... losing confidence but determined!

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

2 Answers

Alan Ayoub
Alan Ayoub
40,293 Points

Hi Kristian,

I totally understand your frustration, do not give up!

First, I see you have extra lines of code on line 1 and line 3. I'd delete those. You came really close to getting the print statement correct, you were only missing commas before and after the variable favorite_color (your code included the commas within the string, they need to be outside of the string).

Anyhow, here is what the working code looks like!

# input function stored in a variable
favorite_color = input("What is your favorite color?")

# prints out the users favorite color
print ("The color",favorite_color,"is a great color!")

I hope that helps, and keep pushing forward!

Thank you kindly,

Very helpful! I appreciate your time.