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
Pro Student 11,172 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
155,530 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 ("=").