Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Logic in Python Conditional Value

Can you please help me understand?

I dont think I need the variables but it passed Task 1 when I set admitted = True

conditions.py
admitted = None
admitted = True
admitted = False

if age >= 13:
    admitted == True
else:
    admitted == False

Are you sure the variable admitted should be the same for all three values?

Jonathan Mitten
Jonathan Mitten
Courses Plus Student 11,173 Points

You do not need to set your admitted variables at the top - you're overwriting the None with True, and then the True with False anyway.

Your conditional statement has the correct syntax, but your assignments of admitted == True should be admitted = True. It's an assignment.

1 Answer

Steven Parker
Steven Parker
221,292 Points

You should not add any code above the "if" line. but you managed to "fool" the validator with it one time.

But on the lines below the "if", you have comparisons ("==") where you should have assignments ("=").