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,769 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,769 Points

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

1 Answer

Mohammed Ismail
Mohammed Ismail
7,190 Points

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