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 (2015) Logic in Python Conditional Value

Step 2

Added else statement and now Task 1 is not passing

conditions.py
admitted = None
if age >= 13:
    admitted = True
    else:
        admitted = False

2 Answers

Michael Hulet
Michael Hulet
47,913 Points

In Python, indentation is very important. It's how the language distinguishes what code goes with what other code. An else statement needs a matching if to go with, which means that they'll have to be indented the same amount for Python to know that they go together, like this:

if some_boolean:
    pass
else:
    pass # This else goes with the above if
Ari Misha
Ari Misha
19,323 Points

Hiya Peckeday! You have identation issues in your code. Your "else" should be indented with your "if" statement. Do that and your code will pass with flying colors. (: