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

Conditions Challenge: Task 2

Hi,

I tried using the code below in order to complete the task but the task does not want to allow me to set the age variable and if don't another error occurs.

Here is the code is used:

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

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

2 Answers

Ari Misha
Ari Misha
19,323 Points

Hiya Megal! Just remove the statement age = 14 from your code, 'coz on the next line in your "if" statement, you're checking for "if age is greater than or equal to 13", age can not be equal to 13 when you've already assigned it to 14. Do that and you're good to go. (:

Thanks Ari. I am good to go to the next task. (:

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