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

Khalifa AlShaali
Khalifa AlShaali
413 Points

If and else with none

The question wants me to have a 'True' value for "admitted," in the 'If' function and a 'False' value for "admitted" in the 'else' function. I seem to get the 'if' value correct but I can't find a way to make the value for 'else' to be 'False'.

conditions.py
admitted = None
if age>=13:
    admitted = (None is None)
    else: 
        admitted = (None)

1 Answer

jonlunsford
jonlunsford
15,472 Points

Khalifa:

The task is asking you to set the variable 'admitted' to true or false based on the the value of the age variable. Such as:

if age >= 13:
admitted = True
else:
admitted = False
Khalifa AlShaali
Khalifa AlShaali
413 Points

Thank you! I seem to have understood the question wrong...but its all clear now. thumbs up