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

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 68,427 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! :)