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

Prompt the user "What is your favorite color? ". Store the result in a variable named favorite_color

What am i doing wrong?

using_input.py
input(favorite_color)
print('What is your favorite color?', 'favorite_color')

3 Answers

Hello @Luis Barahona, input() will allow to to prompt a question to the user and then return the answer as a string that you can in-turn assign as a variable. So to create a variable with the input you could just assign the variable with it, something like: my_fruit = input("what is your favorite fruit? ") so when the user inputs an answer, the answer will be assigned to the variable "my_fruit" in this case. Hopefully this will give you enough guidance to help you solve this one.

nakalkucing
nakalkucing
12,964 Points

Hey Luis! The instructions say:

Prompt the user "What is your favorite color? ". Store the result in a variable named favorite_color, we'll use it in the next task.

Does that clear up your problem? Good Luck! Let me know if you need more help. :)

Thank you @speeddemon, much appreciate it. I was stuck!

happy to help, you got this :)