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 trialBrendan Flynn
Front End Web Development Techdegree Graduate 20,193 PointsWhat am I missing to make this Else statement work?
admitted = none if age >= 13: admitted = True else: admitted = False
admitted = none
if age >= 13:
admitted = True
else:
admitted = False
3 Answers
Jeff Muday
Treehouse Moderator 28,720 PointsYou 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
Brendan Flynn
Front End Web Development Techdegree Graduate 20,193 PointsDoh! You are exactly right. Thanks Jeff!
Jeff Muday
Treehouse Moderator 28,720 Pointshehehe, 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!
Brendan Flynn
Front End Web Development Techdegree Graduate 20,193 PointsOkay, thanks for the tip! Thanks again!