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

Will Lynch
Will Lynch
1,235 Points

Conditional values challenge giving a Bummer! error, what does it mean?

I keep getting the error "Don't set the 'age' - we'll do that for you but if I delete age or set it to a different value I get the error that its not completing the first part of the task. Can anyone see what I'm missing here I have been on a few websites and cant figure this one out.

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

2 Answers

Steven Parker
Steven Parker
229,732 Points

By setting age yourself, you tricked it into passing task 1.

The instructions say you should set "admitted to True if age is 13 or more", but you're only testing for more than 13.

So to legitimately pass task 1 you need to revise your test to include 13 as an "admitted" value.

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

this is the correct code to pass task 1 and 2 the wording is bit weird but later in the track you will understand that he is mimicking an input.

you do not need the age variable becuase the computer is typing it in to find if admitted = True or false