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

Use the favorite_color variable in your print function to output the following message to the screen

I have no idea why this is not working or what I'm supposed to type. Why can't I type any more than this in the box??

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

I didn't ask it to include code, but it has, I couldn't type more than 2 sentences when I was trying to submit the question... Is this path bugging out or something? Because I did this question yesterday, fine. And now, nothing is working and it si doing a bunch of things I'd asked it not to.

It keeps telling me to use Red and then use Mauve.... what the hell is going on???

2 Answers

Tabatha Trahan
Tabatha Trahan
21,422 Points

If you assign the results of the input to a variable named favorite_color, and then print out the string using the variable, it should work:

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

So you are just taking the input and storing it in favorite_color. Then you are printing a string and adding the variable.

Thank you so much 🙏