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

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,197 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
229,921 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 ("=").