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

Anthony Ferrero
Anthony Ferrero
2,533 Points

If / Else

I am unable to get past this code challenge. I tried many things but it always reverts back to "Task 1 is no longer passing"

Ken Alger
Ken Alger
Treehouse Teacher

Anthony;

Please post the code you are using. That error is typical of a syntax error.

Ken

Anthony Ferrero
Anthony Ferrero
2,533 Points

Sorry, I thought I checked the box to include it. The challenge is:

OK, one more. Add an else to your if. In the else, set admitted to False.

admitted = None
if age > 13:
  admitted = True:
    else admitted = False
Anthony Ferrero
Anthony Ferrero
2,533 Points

For some reason it is not recognizing when I enter code with the "ticks" on the comment section, each on is on a different line.

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Anthony;

Correct code, bad indentation. Isn't Python fun that way? Your else statement needs to be at the same indent level as your if statement.

Happy coding,
Ken

Anthony Ferrero
Anthony Ferrero
2,533 Points

Got it to work! Thank you!