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 trialLikuwa Kadhira
2,211 Pointswhat does that mean ERROR: test_variable_gets_set (__main__.TestCreateAVariableExecution)
my.py
favorite_color = "Red"
print(favorite_color)
python my.py
6 Answers
Steven Parker
231,275 PointsI'm not sure what that error means, and I wasn't able to replicate it. But here are some issues relative to the challenge:
my.py # <-- this is not a Python statement
favorite_color = "Red"
print(favorite_color)
python my.py # <-- this is also not a Python statement
Then, after removing the non-Python lines, the code for task 2 isn't complete yet. This code will print the color itself, but the challenge instructions say to print "The color [YOUR FAVORITE COLOR]
is my favorite!". So you need to build up and print this larger string that includes the color as part of it.
Likuwa Kadhira
2,211 PointsOkay I'm getting errors
Steven Parker
231,275 PointsPost the code as it is now. Be sure to use Markdown formatting to preserve the appearance.
Likuwa Kadhira
2,211 PointsOkay
Likuwa Kadhira
2,211 Pointsfavorite_color = "Red" print("red,"," is my favorite!")
Steven Parker
231,275 PointsCloser, but they want you to use the variable instead of putting the word "red" again. And the sentence should begin with "The color".
Likuwa Kadhira
2,211 Pointsokay thanks
Likuwa Kadhira
2,211 PointsThanks, man I finally got it right
Steven Parker
231,275 PointsLikuwa Kadhira — Glad to help. You can mark the question solved by choosing a "best answer".
And happy coding!