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.

Python Python Basics (2015) Logic in Python Conditional Value

Justin Ricke
PLUS
Justin Ricke
Courses Plus Student 345 Points

What am I doing wrong, I keep getting the error that task one is no longer executing. my code is below:

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

[MOD: added ```python markdown formatting -cf]

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

It's a bit hard to read your markdown here in the question, but I don't see anything blatantly incorrect. Could it be an indentation error, I wonder? Try this:

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

I see two separate lines saying admitted = None. If that's actually in there twice, it could cause it to fail.

Justin Ricke
Justin Ricke
Courses Plus Student 345 Points

Not sure why admitted was in twice I think that just is how it copied I only have it once in my code. Thanks for your help!

Chris Freeman
Chris Freeman
Treehouse Moderator 67,989 Points

In the OP, the second admitted = None was added by the help system automatically adding the current state of the challenge code which was simply this statement. The code above it was manually added by Justin. After reformatting Justin's post, it becomes evident Jennifer's answer is correct.

Justin, also note that often the message "Task 1 is no longer passing" indicates a syntax error has been introduced that causes all tasks to fail. In this case, the syntax error is the improper indentation.

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Thanks Chris Freeman for clearing up that markdown and explaining the "extra" admitted = None. I wasn't really sure why it was displaying that way... now I know! :)