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

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

admitted = None
if age = 13:
    admitted = True
        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