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 trial

Python Python Basics Meet Python Create a Variable

how do i write purple is my favorite color?

i finished task 1 and wrote favorite_color="purple" but i cant add it to a sentence

using_variables.py
favorite_color="purple"
The color favorite_color="purple" is my favorite!

1 Answer

You need to print that sentence. Remember the print("[Something goes here]") function? Try reviewing the previous video. Also, remember a variable is like a box that stores information. You've already put that you're favorite color is purple, now all you need to do is put the variable. So on the second line, you only need to use favorite_color, but you don't need ="purple". You only need that on the first line.

She will also need to concatenate the base of the sentence with the variable favorite_color inside the print function. Don't forget about spaces!