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 trialKhristafer Homan
Python Development Techdegree Student 55 Pointsmy quiz is to write 2 values using the variable favorite_color, but I don't know where to start.
- favorite_color = ("Green", and "Blue")
- print(favorite_color)
2 Answers
Steven Parker
231,236 PointsIt's not clear what course and lesson you are referring to. You might want to take a look at this video about Posting a Question.
But for starters, favorite_color = ("Green", and "Blue")
isn't proper syntax. If you really want to include both items as your favorite color, they need to be combined into a single string, like this: favorite_color = "Green and Blue"
. But that's complicating the exercise, as favorite_color would normally be assigned a string naming a single color.
Add a link to the course page and I can give a more detailed and specific answer.
Jacob Todd
4,072 Pointsthe word and isn't typically used in any form of programming. most professional programmer's use the ampersand.
Steven Parker
231,236 PointsYou are for sure thinking of another language!
This question is about the Python language, where and
is a valid keyword but &&
is not valid.
Jacob Todd
4,072 PointsJacob Todd
4,072 Pointstechnically correct, but not a great answer. the syntax is wrong yes. but the code is correct. and is usable just in && form.
Steven Parker
231,236 PointsSteven Parker
231,236 PointsJacob Todd: I don't know what you mean by "is usable just in && form" ... are you perhaps thinking of a different language?