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 Conditional Value

I 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??

conditions.py
admitted = None
if age>=13:
    admitted = True

3 Answers

Samuel Ferree
Samuel Ferree
31,722 Points

This doesn't work?

admitted = None
if age>=13:
  admitted = True
else:
  admitted = False
Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Yungi;

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

Oh, I figured it out thank you.