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

Else portion not out for me.

Im trying to do the else portion of this statement i keep getting task one no longer working when i put the condition as 'age <= 13:' or even no condition, what should i do?

conditions.py
admitted = None

if age >= 13:
    admitted = True
else age <= 13:
    admitted = False

3 Answers

Wesley Trayer
Wesley Trayer
13,812 Points

The "else" statement doesn't take a condition because it is true if the "if" statement is false. So it should read:

else:
    admitted = False

yeah i tried that as well and still got the same response

Wesley Trayer
Wesley Trayer
13,812 Points

I don't see anything else wrong with your code, but I have occasionally found that by erasing the all of the code and pasting identical code, copied from somewhere else, into its place, it lets it pass.

Sorry, but I don't have any other ideas.

Wesley Trayer
Wesley Trayer
13,812 Points

Well, I just redid the challenge, again, and I found that because had two spaces between "if" and "age >= 13" it failed me. Maybe you have an extra space somewhere.