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

Brian Healy
Brian Healy
485 Points

If a=None, but b is not defined, how do you write a conditional statement comparing all values of b to make a true?

Help?

conditions.py
admitted = None
if age >= 13:
    admitted == None
else:
    admitted != None

1 Answer

Abraham Juliot
Abraham Juliot
47,353 Points

Hi Brian,

In this challenge, we are just writing code for the condition--it's assumed the variable age is already named and given a value. Recall that a boolean value is either True or False, and note only one "=" is used to assign a value to a variable. See the first video. The value None just represents the absence of a value. I hope this helps.

admitted = None
if age >= 13:
    admitted = True
else:
    admitted = False
Darren Taylor
Darren Taylor
1,052 Points

Thanks for giving an accurate explanation for this task to us. It's helped me overcome this obstacle after a long time trying!