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

Sean Barry
Sean Barry
4,264 Points

Logic bug in "if" test in Python basics

I try setting age in task one, it passes. Then in task two it says don't set age, we'll do that for you. Alright... Try unsetting age, and I get an errror saying admitting isn't true. Come on guys

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

1 Answer

Alexandra Barnett
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 Points

Hi Sean! You don't need to set age and you need a True and a False assignment to admitted. You will need to check if age is greater than or equal to 13 rather than just greater than and you also need the else statement to set admitted to False.

Hope that helps - let me know if you have any questions and I am happy to help further ???