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

if/ Else statement exercise.

I do not understand task two of the exercise, when I set it to true it says admitted is not false. when I set admitted to False it says task 1 is no longer running.

conditions.py
admitted = None
age = 20
if age >= 13:
  admitted = True
else: 
   admitted = False

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,426 Points

In the challenge, you should not set the variable age. It is set by the challenge grader. Comment out this line and it should pass!

I did set the age, its set to 20?

Never mind I got it, Thank you very much! sorry for the misunderstanding.

Chris Freeman
Chris Freeman
Treehouse Moderator 68,426 Points

Sorry. I left out the word "not". Answer updated. But you figured it out already!

I am not understanding what i am dong wrong here:

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

keeps telling me admitted is not False... it won't be, ever. What value is age supposed to be set to?

[MOD: added ```python formatting -cf]

Chris Freeman
Chris Freeman
Treehouse Moderator 68,426 Points

You have set a value to age that is interfering with the grader. Comment out age = 30