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

Nico Romero
Nico Romero
1,365 Points

else to equal false

I don''t understand what the question is asking me, it says to create an else statement/comparison and so I create else as well and set admitted to false but marks it as incorrect

conditions.py
admitted = None
admitted = True
age = True
if age > 13:
    print("admitted")
else:
admitted = False

3 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,454 Points

The specific error is the last line is not indented far enough. It should be indented relative to the else.

Beyond that, the code passes, but is not exactly like the desired result. Instead of always assigned admitted to True, move that line to replace the print statement line. Then admitted is actually only set to true when age > 13.

Nico Romero
Nico Romero
1,365 Points

Hi Crhis, Thank you. I removed print and just made the comparisons instead. Thank you again for all your help!

Nico Romero
Nico Romero
1,365 Points

Sorry Chris, I spelled your name wrong

Chris Freeman
Chris Freeman
Treehouse Moderator 68,454 Points

No worries. You can always edit your previous posts by selecting the three grey dots to the right of Add Comment / Best Answer.