Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Anne Manning
5,415 PointsI keep getting message OOPS task on is no longer passing?
I cant seem to get past this section to continue on with the training. I believe that my code is correct. Any help/direction will be appreciated.
admitted = None
if age >= 13:
admitted = True
else:
admitted = False
3 Answers

Haider Ali
Python Development Techdegree Graduate 24,724 PointsHi there Anne, in python, blocks of code are specified by indentation. If you were using JavaScript, you would put curly braces around a block of code. However, in python, blocks of code are specified by just using indentation so python knows which code belongs to what. In your code, the else
block is indented inside the if
block and shouldn't be. If an else
and if
are part of the same conditional statement, they should be indented to the same level. Here is how it should look:
admitted = None
if age >= 13:
admitted = True
else:
admitted = False
If you have any other questions, please leave a comment.
Thanks,
Haider

Jason Anders
Treehouse Moderator 145,728 PointsHey Anne,
While the code is correct, the indentation is off. Python is indent specific when it comes to programming syntax. Right now, the way you have it written, the else
clause is inside the if
statement. You want the else
to be on its own. Just remove the indent on your else
clause.
Hope that helps. Keep Coding.

Anne Manning
5,415 PointsWooHoo! That worked!!! Thank you very much!!

Levis Vazquez
961 PointsThanks for your comment, I was stuck here.

Ary de Oliveira
28,298 Pointsadmitted = None
if age >= 13:
admitted = True
else:
admitted = False
Anne Manning
5,415 PointsAnne Manning
5,415 PointsThank you very much. I forgot the indentation!