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 Types and Branching Use an if

How do I check that favourite_color = "blue" ?

I've used an if statement and I'm not able to check

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

2 Answers

Jonathan Fernandes
PLUS
Jonathan Fernandes
Courses Plus Student 22,784 Points

I just ran the following code in my interpreter and it works fine:

color = "blue"

if color == "blue":
  print("You must love the sky")

Do you mind giving me more details on the output you are getting and the environment? Because your code should be fine.

Thanks for helping. I noticed my error. In the UK we spell favorite different so technically I was using the wrong variable name.

Jonathan Fernandes
PLUS
Jonathan Fernandes
Courses Plus Student 22,784 Points

Oh wait... is their too much spacing on your indent? Or inconsistent spacing? In other words, is this a piece of your code and that print line is the only thing that is over-indented?