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

jonathan arriaga
jonathan arriaga
416 Points

having issues understanding why task 1 is no longer passing after i right this code? i believe it should be correct

looks my code is correct need help

conditions.py
admitted = None
if age = 13:
    admitted = True
    else:
        admitted = False
Abdishakur Hassan
Abdishakur Hassan
3,585 Points

age = age == Are different. Try ==

1 Answer

Two mistakes:

  • You are using the = operator to check equality. Python thinks that you are trying to make a variable. You need to use == to check equality so that Python understands that you aren't making a variable.
  • The last two lines are indented too far. Python thinks that there's a else clause inside the if clause. You need to de-dent the line a little more.
jonathan arriaga
jonathan arriaga
416 Points

thank you for the information! i figured out the problem had to many indentations. and i guess i had to skip a line before writing the if block