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

Abdul haseeb
Abdul haseeb
569 Points

inputting

Use the favorite_color variable with your print statement to output the following message to the screen :

The color [USER INPUTTED COLOR] is a great color! I will respond with my favorite color when I run your script. For instance, if I enter "purple" I want your code to print:

The color purple is a great color!

using_input.py
favorite_color= input("what is your favorite color? ")
Edwin V
Edwin V
4,947 Points

Hey Abdul hope you are doing well man. I just started also but it took a few tries for me to get this one after getting syntax error a few times. The first variable input is correct from what I can tell. Remember the task wants you to now create an output using the favorite_color variable so try using the print function(output) followed by the instructions "The color [USER INPUT] is a great color!

print =("The color" , "favorite_color", "is a great color!")

8 Answers

The input statement prompts the user and saves the value into a variable favorit_color. Now you just need to print the result and concatenation your newly assigned variable. So, try something this after what you have above,

Print (‘the color ’ + favorite_color ‘ + ‘ is a great color’  )

Just wanted to add that the + is the concatenation operator which basically just sticks what ever is on either side to together.

man this challenge is hard as fuck i dont understand why we dont have a hint bar or something its annoying as fuck]

favorite_color= input("what is your favorite color? ")

print("The color ", favorite_color, " is a great color! ")

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

print("The color", favorite_color, "is a great color!")

Idk what I'm doing wrong here.

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

favorite_color= input("what is your favorite color? ")

than below it copy this print("The color ", favorite_color, " is a great color! ")

Garen Bolash
Garen Bolash
415 Points

having trouble doing this question I put this in

favorite_color = input("What is your favorite color?")

print("The color ", favorite_color, " is a great color! ")