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

Anton Jaya
Anton Jaya
2,480 Points

Keep getting Oops! It looks like Task 1 is no longer passing.

I have tried every possible way to pass the else statement


else elif else / if else if not elif not


but I kept getting the same issue. I have even got a message just saying Try Again as a term for a fix but I cannot seem to find the answer. I have been working on this one problem for about 3 days now and I am not sure what to do with the issue!.

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

2 Answers

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

Hi there! You're doing great, but something has happened to your code between when you submitted it from the first step and what it is currently. The task asks you to set admitted to the boolean value of True. Currently, you are setting it to the string value of "True".

The code at the end of step one should look like this:

admitted = None
if age >= 13:
    admitted = True  #note the removal of the quotation marks here

The same thing will need to be done when setting the value to False. It should be the boolean value False and not the string value. If I simply remove the quotation marks from both, your code passes with flying colors!

Hope this helps! :sparkles:

I have the same problem, although I clear the quotion mark: Oops! It looks like Task 1 is no longer passing.
conditions.py

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

Sergii Guk
Sergii Guk
2,037 Points

Hi Anton, you don't need to have 'else' section here, you're asked to set admitted to 'True' if age is equal or bigger than 13, otherwise it should stay 'None'. So for task 1 you should have only:

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