Python Python Basics (2015) Logic in Python Conditional Value

Brendan Flynn
Brendan Flynn
Front End Web Development Techdegree Student 13,373 Points

What am I missing to make this Else statement work?

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

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

3 Answers

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 21,419 Points

You are very close, I think the challenge failed because 'none' should be 'None'

None requires capitalization, just like True and False do.

Another issue might be the spacing in the 'if' block appears to be inconsistent with the 'else' block.

Spacing in Python can be a little frustrating at first, but it does keep code very readable and consistent.

Best of luck with Python, it's a lot of fun!

admitted = None
if age >= 13:
    admitted = True
else:
    admitted = False
Jeff Muday
Jeff Muday
Treehouse Moderator 21,419 Points

hehehe, a good IDE will syntax-highlight these inconsistencies. I use Wingware, but another excellent choice is PyCharm EDU. A good IDE can increase productivity, but some people love going old-school on vi, emacs, and nano!