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

Antonie Huang
Antonie Huang
985 Points

How can I make admitted to False?

How to set admitted to False?

conditions.py
admitted = None
age = 14
if age >= 13:
    admitted = True
else:
    admitted = False
David Rodriguez
David Rodriguez
4,028 Points

You have to change your age is less than 13, since that is your conditioning

2 Answers

Tobias Helmrich
Tobias Helmrich
31,603 Points

Hey again Antonie,

the problem is the same like before: You don't have to set the age variable as this will be done automatically when the challenge is tested.

This should work:

admitted = None
if age >= 13:
    admitted = True
else:
    admitted = False
Tobias Helmrich
Tobias Helmrich
31,603 Points

No problem, I'm always happy to help! :)

Tobias Helmrich is absolutely correct. You do not need to set the age variable you just need to create the if statement that checks what the question is asking for... "make an if condition that sets admitted to True if age is 13 or more"

So just remove the part that it's not asking you to do (setting the age variable) and you are golden!

ps. make sure you give @Tobias Helmrich credit for the right answer ;)