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

Filippa Grenmark
Filippa Grenmark
1,309 Points

if, else, and elif

instructions: The code to accept input for the favorite color has been provided for you.

For this task, add a branch that checks if the favorite_color is equal to "blue".

If it is indeed "blue" print out to the screen, "You must love the sky!"

my answer: favorite_color = input("What is your favorite color? ") if favorite_color == "blue": print("blue")

Jeff Muday
Jeff Muday
Treehouse Moderator 28,717 Points

Did you have a particular question you wanted to be answered? It looks like you understood the question, but the challenge asks specifically: The code you supplied should print out "You must love the sky!"

This might be what you were looking for:

favorite_color = input("What is your favorite color?")
if favorite_color == "blue":
    print("You must love the sky!")

Good luck with Python. It is really worthwhile and fun to program!

1 Answer

If it is indeed "blue" print out to the screen, "You must love the sky!". You printed "blue"