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

Ricky Ackerman
Ricky Ackerman
705 Points

whenever a variable name = None i get thrown off. How do I set it to True

admitted = None if age >= 13: print(admitted)

conditions.py
admitted = None
if age >= 13:
    print(admitted)
Ricky Ackerman
Ricky Ackerman
705 Points

when I do the following in workspaces it works, but I can't pass the challenge. Help please

admitted = None
admitted is None
True
age = 13
if age >= 13:
... admitted == None
... else:
... admitted != None
...
True

1 Answer

Sorry, I don't understand the question, what is it that you want to do? Also more context on the question would be great :)

Ricky Ackerman
Ricky Ackerman
705 Points

Sorry, forgot to add the question. Challenge Task 1 of 2

I'm going to create a variable named age. I need you to make an if condition that sets admitted to True if age is 13 or more.

Kay i got you. admitted = None admitted is None True age = 13 if age >= 13: ... admitted == None ... else: ... admitted != None ... True

Regarding what you written here, if the question wants you to set admitted to True then why are you using == to None once you state the condition age >= 13 just write admitted = True