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

Ohad Buzaglo
Ohad Buzaglo
1,164 Points

I add the else properly. why it doesnt work???

I did part 1 of the question properly, but when I add the else it gives me an error.

conditions.py
admitted = Non
if age >= 13:
    admitted = True
    else:
        admitted = True
Ohad Buzaglo
Ohad Buzaglo
1,164 Points

i ment in the else that admitted is set to False

3 Answers

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Remember that spacing matters. The if and else should be lined up.

Try to fix the spacing and see if that doesn't fix it.

Good luck!

nakalkucing
nakalkucing
12,964 Points

You misspelled 'none'. But aside from that I would suggest you take a look at the indentation of your else statement. Did that make it clear? Hope this helps, Nakal

Ohad Buzaglo
Ohad Buzaglo
1,164 Points

thank you guya I figured it out!