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

Abdulraheeem Bakare
Abdulraheeem Bakare
4,020 Points

help me

using_input.py
favorite_color=input('What is your favorite color? ')
input=('Red')
print('The color [USER INPUTTED COLOR] is a great color!')

2 Answers

Steven Parker
Steven Parker
231,269 Points

The line of code that assigns "input" is not needed and can be omitted.

And where they show "[USER INPUTTED COLOR]" in the example, they don't want those exact words to appear in the output. Instead, they want the contents of the variable "favorite_color" to be shown in that spot. You can do this several ways such as multiple arguments, concatenation or using the "format" function (your choice).

Heidi Fryzell
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree seal-36
Heidi Fryzell
Front End Web Development Treehouse Moderator 25,178 Points

Hello Abdulraheeem,

In this challenge, we dynamically assigning the favorite_color variable through the input the user types in.

You don't need that second line where you assign the input to "red". The user is going to type in the their favorite color and it will get assigned to the favorite_color variable.

Then in order to print the user's favorite color to the screen, you need to include the variable name, favorite_color, in the print statement.

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

If this is still confusing I recommend watching the video right before this challenge again. The teacher goes through a very similar example.

Hope this helps. And Happy Coding! Heidi