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

Tim Baggenstos
Tim Baggenstos
916 Points

Help on Challenge Task.

I am trying to complete a challenge task in the Python beginner course which has this text: I'm going to create a variable named age. I need you to make an if condition that sets admitted to True if age is 13 or more. It does not accept the code that I have included here. Please help!

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

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! First, the challenge is going to set the value of age, and your code is going to test it. By having the age = None you are writing over what they're sending in, so you can safely remove that line. Also, your code should test if the age is 13 or more. But you're currently testing to only see if the age is more than 13. The person should also be admitted if they are 13.

Take another shot with these hints in mind, but let me know if you're still stuck! :sparkles: