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

Josue Bohorquez
Josue Bohorquez
426 Points

I don't know what I am doing wrong here.

It keeps telling me that Task 1 is no longer passing. Please help!

conditions.py
admitted = None

if age >= 13:
    admitted = True 
    else: 
        admitted = False
Dave StSomeWhere
Dave StSomeWhere
19,870 Points

Looks like an indentation problem - is that how Kenneth coded an IF ELSE?

angel moreta
angel moreta
2,912 Points

Your code is perfectly fine, all you have to do is indent backwards the "else:" statement and it's block of code

Dave StSomeWhere
Dave StSomeWhere
19,870 Points

Just to be silly, improperly indented code is not perfectly fine - it is wrong in Python.

1 Answer

Josue Bohorquez Hi Josue, The problem is with the indentation of the else block.

Here is the code to look at:

admitted = None if age >= 13: admitted = True else: admitted = False