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 for Kids The Number Guessing Game Use an if

Khambrel Davis
Khambrel Davis
1,073 Points

give me the answer

branching.py
favorite_color = "blue"

1 Answer

Laura Coronel
STAFF
Laura Coronel
Treehouse Teacher

Hey Khambrel Davis! It looks like you only set the variable, but didn’t add the conditional logic the challenge is asking for.

Go ahead and rewatch the If, Else, and Elif video to review how to create branches in your code. Then try adding an if statement that checks whether favorite_color is equal to "blue" and prints the required message.

Also, don’t forget, you can click the Hint button in the challenge if you get stuck. It’ll point you in the right direction without giving everything away.

Give it another shot and see how it goes!