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 If This Then That

Answer for Q2: admitted = None if age >= 13: admitted = True else: admitted = False

This code gets "step 1 no longer passes" error.

3 Answers

Joshua Clark
Joshua Clark
6,186 Points

On task 2 "OK, one more. Add an else to your if. In the else, set admitted to False." I can't seem to figure out why it won't let me use the else. I have double checked my indentation and still am having an issue. My code looks as shown:

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

Thank you Alexey! Changing the indenting to your example fixed the problem and the autograder liked it. Thank you.

Joe