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 trialAidan Walker
1,472 PointsPython basics 2 - Now write out to the screen The color [YOUR FAVORITE COLOR] is my favorite!
Now write out to the screen The color [YOUR FAVORITE COLOR] is my favorite!, where [YOUR FAVORITE COLOR] is using the variable you created in Task 1. Asking a beginner to do this, what an earth does that mean??
favorite_color="red"
the coolor("your favorite color")
6 Answers
Aidan Walker
1,472 PointsThanks for the fast reply that makes a lot more sense print("favorite_color")
Jen Farrant
6,905 Pointswhat Andren said. I sometimes have to watch videos a few times to get the code challenges. They are challenges after all!
Ibrahim Price
255 PointsShout out the purest player of all time Andren i was pulling my hair only to find out i missed the comma after 'favorite_comma'. thanks, stay pure!
Aidan Walker
1,472 PointsNow its saying that its wrong ive also tried print("red is my favorite!") and print("the color red is my favorite!"). I've cancelled my membership this isnt for beginners imo,thanks anyway.
andren
28,558 PointsYou need to mix the string and the variable, it should not be purely the one or the other.
Like this:
favorite_color= "red"
print("The color", favorite_color, "is my favorite!")
This challenge, like most of the beginner challenges, are strongly tied to the code shown in the video directly preceding it. In the previous video you were introduced to variables and to printing out variables and strings together in the way shown above.
While you are certainly entitled to cancel your subscription if you are not satisfied with your experience I would disagree that this particular exercise is a good reason to do so.
Learning how to print out text and how to use variables are almost always the first things thought in programming courses, regardless of language, as they tend to be the simplest concepts to learn in the beginning, and they are both pretty essential going forward in the language as well.
Clayton Sibanda
5,044 PointsThanks Andren, was stuck on it.
Rudolfos Neofytou
210 Pointsfavorite_color="blue" print("the color", favorite color, "is my favorite!")
Where is my syntax error?
Hoessein Abd
Python Web Development Techdegree Graduate 19,107 PointsYou forgot the underscore. should be:
print("the color", favorite_color, "is my favorite!")
Torin Webster
656 PointsOkay, I understand syntax being a major key in programming, but I never remember the instructor stressing the importance of commas within arguments.