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 trialChristian Geib
826 PointsChallenge task 1 of 2 -not sure how to go about age true or false
No quite sure what I am supposed to do here. The question appear sto ask me not to set an age and instead worry about the IF condition. My apporoach
if not age >= 13: admitted = False else: admitted = True
does not seem to work . Any advice?
if not age >= 13:
admitted = False
else:
admitted = True
2 Answers
Thayer Y
29,789 Pointsadmitted = None
if age >= 13:
admitted = True
else:
admitted = False
suliman alkous
Courses Plus Student 5,139 Pointscheck the spaces else should be on same column of "if"
admitted = None
if age >= 13:
admitted = True
else:
admitted = False
Christian Geib
826 PointsThanks Suliman for the quick response & your instruction, your rock! Much appreciated!
Christian Geib
826 PointsBtw, Thayer, when I enter the code you suggested,
admitted = None if age >= 13: admitted = True else: admitted = False
and I click on 'Check work', I receive the following error notice: Bummer! invalid syntax (<string>, line 5)
Any idea why that is?
Christian Geib
826 PointsChristian Geib
826 PointsThanks, Thayer, for the quick, super helpful response. Much appreciated!
Christian Geib
826 PointsChristian Geib
826 PointsBtw, Thayer, when I enter the code you suggested,
admitted = None if age >= 13: admitted = True else: admitted = False
and I click on 'Check work', I receive the following error notice: Bummer! invalid syntax (<string>, line 5)
Any idea why that is?