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

Ohad Buzaglo
Ohad Buzaglo
879 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
879 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
879 Points

thank you guya I figured it out!