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 trialOmar Salim
150 PointsWhy is this wrong?
favorite_color = input(" what is your favorite color?")
favorite_color = "Blue"
print("The color", Blue , " is a great color!")
3 Answers
Rick Gleitz
47,840 PointsHi Omar,
Just a few problems here.
Your second line is not needed. It redefines the variable favorite_color to mean only Blue. You want whatever color the input is to be printed in the statement, not just Blue.
To do that, in the third line replace the word Blue with the variable name, which now contains whatever color was put in, so it will show up in the statement.
Lastly, take out the space before the word 'is' in your print statement. It's not needed and will cause the Treehouse's checking system to throw an error.
(Technically, the statement in the first line should not begin with a space either, and the 'what' should be 'What', but neither of these threw an error. On some challenges such things might do so. It's best to always match what the instructions say exactly).
I hope this helps!
Wazir Ali
Python Development Techdegree Graduate 17,115 PointsWhat are you trying to do?
Alan Luo
223 PointsI was confused at the beginning of this question, so I youtube python found different ways to achieve this. favorite_color = input("What is your favorite color\n")
print(f"The color {favorite_color} is a great color!")
Omar Salim
150 PointsOmar Salim
150 PointsThank you so much. I appreciate your help.
Omar Salim
150 PointsOmar Salim
150 PointsThanks . I really appreciate your help.