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 trialarjunyad
Python Web Development Techdegree Student 444 PointsWhere [YOUR FAVORITE COLOR] is using the variable you created in Task 1.
i don't get it
favorite_color = "red"
The color print(favorite_color) is my favorite!
1 Answer
<noob />
17,062 PointsHi! how are u? in this challange u have being asked to declare a variable with ur favorite color, this part u were doing wel! in the second part all u need to do is to print to the console the color u have chosen which stroed in favorite_color, ur doing that in a way called formatting.
the working code is:
favorite_color = "red
print("the color {} is my favorite".format(favorite_color))
{} = this is a place holder which will hold the favorite_color variable. .format(favorite_color)) = basically u have to write .format and then open a pair of () and inside them u pass the variable.
if this answer your question please mark as best answer
Luis Cardenas
1,501 PointsLuis Cardenas
1,501 Pointsfavorite_color = "Red" print ("my favorite", "color is,") (favorite_color)
why this is wrong?