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

Kimberly Lie
Kimberly Lie
3,617 Points

presence of the 'age' variable in my code does not allow me to progress

hi, i tried deleting the 'age' variable from my code since the error stated that the 'age' variable have already been created and i do not need to create it anymore, but when i removed the 'age' variable i am not fulfilling the requirements in task 1. how do i pass this stage?

conditions.py
admitted = None
age = 14

if age > 13:
    admitted = True
else:
    admitted = False
Luke Hayes
seal-mask
.a{fill-rule:evenodd;}techdegree
Luke Hayes
Python Web Development Techdegree Student 1,230 Points

Admitted is supposed to be returned True if age is greater than or equal to 13. Your code is only checking if age is greater than 13, so admitted is going to return false if the person is 13 years old and not True until you have someone that is 14.

admitted = None

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

2 Answers

Ryan S
Ryan S
27,276 Points

Hi Kimberly,

The key with this one is the phrase "13 or more" in the Task 1 instructions, i.e., greater than or equal to.

Unfortunately, there seems to be a bit of a bug in this challenge where if you set an age variable (even though you are not supposed to), you can still pass task 1 with only a "greater than" condition. But Task 2 will catch both errors.

Hope this helps.

EDIT: This bug has now been fixed.

Kimberly Lie
Kimberly Lie
3,617 Points

Oh ok! Missed the greater than or equal to part. Thanks for the help guys I think I got this! :)