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

What am I doing wrong?

Thanks for the help on the previous task. I was able to get it finally when I didn't have a bunch of distractions in my way. However, I feel like I am doing this right, but clearly I'm not. I don't understand.

conditions.py
admitted = None
if age >= 13:
    admitted = True
    elif < 13:
        admitted = False

2 Answers

Hoessein Abd
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Hoessein Abd
Python Web Development Techdegree Graduate 19,107 Points

Your if statement is correct. The problem is in your elif statement and the indenting.

The 2nd challenge is asking you to write an else statement not an elif, to check if age is not bigger or not equal to 13. so you dont need to write an elif condition because anything that isn't 13 or bigger than 13 will be covered in else.

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

That is what I am supposed to do? I'm starting to hate Python. Seriously? I entered the exact same thing as I tried and tried to do this, but the only way to fix it was to <BACKSPACE> several times to put all the wording in place. Damn! Python is insanely picky!

Hoessein Abd
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Hoessein Abd
Python Web Development Techdegree Graduate 19,107 Points

Hey Sean,

Do you have Pycharm installed? I'd suggest installing the community edition and do your code challenges in there it gives you more information as to what you're doing wrong. It spots mistakes like these immediately. If youre done just copy it to treehouse.

Dude! Thanks! I appreciate that! I'll definitely install it. Sorry, I was just reacting out of anger and frustration. I don't actually hate Python. I can't hate it when I need to learn it or some other form of coding to eventually have a successful career. Pycharm huh? Is that a web extension or an app?