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

Gang Liu
Gang Liu
519 Points

2/2 is my coding right?

I looked at the indentation and it looks the same to me. However, it did not work.

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

3 Answers

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

Hi there! You're doing fine! But take a look at the Bummer message.

Bummer! Don't set the age variable, I'll do that for you.

Your code is overwriting what Treehouse is using to test it. Remove this line:

age = 15

On a side note, this will make your code pass the challenge. But the challenge does ask for the age to be 13 or more. Technically, you should have this:

if age >= 13:

But again, it's not absolutely required for the challenge.

Gang Liu
Gang Liu
519 Points

Yes, it worked after I removed the age = 15. Thanks!

yes it did