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 trialDinmukhamed Dostemessov
1,461 PointsWhat is the problem here? I don't get it.
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!")
1 Answer
derekverrilli
8,841 PointsThere are a couple things.
First, instead of printing the message you are assigning everything in the parentheses to the variable named "print". Remove the '=' and leave no space after 'print' to fix that.
Second, to concatenate the strings you need '+'. Replace the commas with '+' and leave spaces in the strings for the variable to fit.
favorite_color = input("What is your favorite color? ")
print("The color " + favorite_color + " is a great color!")
Dinmukhamed Dostemessov
1,461 PointsDinmukhamed Dostemessov
1,461 PointsThanks buddy! I don't understand why on earth I've put '=' after 'print', and I had no idea about those spaces.
derekverrilli
8,841 Pointsderekverrilli
8,841 PointsNo problem! Mistakes are the way to learn. Keep it up!