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

conditions.py

I don't know how to change admitted in this case to True

3 Answers

Thomas Fildes
Thomas Fildes
22,687 Points

Hi Noel,

The correct code is below to complete the first task:

admitted = None

if age > 13:
    admitted = True

Hope this helps! Happy Coding!!!

in the same challenge i have a problem with the second question. it say add an else part, inside it set admitted to False. But it says task one is not passing! I can't figure out what is wrong with my code.

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

Your else block is indented too far, more it back in line with the if statement

Hello,

so you start off with admitted = None, on the screen. Out of sight someone has set age = ?unknown?, but just assume for clarity's sake that right above admitted = None, it is written age = 13.

just write an if statement below the admitted variable assignment, that says If the variable age is greater than or equal to 13, then in the block below the statement assign admitted to the value True