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 trialJack Cummins
17,417 PointsNeed help with code challenge. Why am I wrong?
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!
What code would pass this scienario? Jack
Thanks!
favorite_color = input("What is your favorite color? ")
print("The color ", favorite_color, " is a great color")
2 Answers
Brandon Spangler
8,756 Pointsprint("The color "+favorite_color+ " is a great color") Also, Rimvydas Česonis code does pass.
Rimvydas Česonis
8,170 PointsHello,
print("The color ", favorite_color, " is a great color") # you left extra space on both of your strings one after and one in front of it. You need only one, first one.
Updated: for Task 1
favorite_color = input("What is your favorite color? ")
for Task 2
favorite_color = input("What is your favorite color? ")
print("The color ", favorite_color, "is a great color")
I did not post you correct answer at first, because I wanted you to find it yourself, but here it is. I checked it myself and it works.
Jack Cummins
17,417 PointsThat code does not pass.
Craig Dennis
Treehouse TeacherThe extra space in "The color "
is not needed. print
with multiple arguments will join all values separated by spaces.
Jack Cummins
17,417 PointsThanks Craig! You are the best! You are my favorite teacher on treehouse. I love your teaching style!
Craig Dennis
Treehouse TeacherThanks Jack!