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

Ayaz Alam
Ayaz Alam
564 Points

I am passing Task 1, but when i go to Task 2, it says Task 1 is not completed. why?

Task 1 :

admitted = None

age = 14

if age >= 13: admitted = True

Task 2 :

admitted = None

age = 14

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

conditions.py
admitted = None

age = 14

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

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Ayaz,

When you get that error, it almost always means that you have introduced a syntax error in the current task you are working on, not the one that the error says is no longer passing... I know... a very misleading error.

Here, you have a couple of issues.

  1. The challenge didn't ask for you to declare an age variable, so the line age = 14 needs to be deleted.
  2. Your if/else statement has some indentation issues, and this is what is causing your "Bummer!" message. Your else statement should not be indented. When it is (as you have it, it is then inside of the if statement.

Just delete that one line... fix up the indentation... and you'll be good to go.

Keep Coding! :) :dizzy: