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 trialAccountDeleted J
517 PointsI don't know what to do with 'else'
admitted = None if age >=13: admitted = True
From here, I have to use else for making admitted False. If I add else and write admitted = False, it is wrong. What am I supposed to do??
admitted = None
if age>=13:
admitted = True
3 Answers
Samuel Ferree
31,722 PointsThis doesn't work?
admitted = None
if age>=13:
admitted = True
else:
admitted = False
Ken Alger
Treehouse TeacherYungi;
I'd be curious to see your syntax for your else
statement. It sounds like you have the right idea.
Post back if you're still stuck on this.
Ken
AccountDeleted J
517 PointsOh, I figured it out thank you.
Henrik Christensen
Python Web Development Techdegree Student 38,322 PointsTry something like this :-)
if age >= 13:
# do something
else:
# do something