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

Alfredo olivier
Alfredo olivier
1,669 Points

conditional value

i cant solve this

conditions.py
admitted = None
age = 14
if age >= 13 

The challenge states that HE will be making the age variable, so you don't need to do that. Just assume the age variable is already set, you just don't see it for now.

So, now "you (to) make an if condition that sets admitted to True if age is 13 or more."

You've got the condition, but you haven't added the statement to make 'admitted' = True based on that condition.

Try it.

3 Answers

Wade Williams
Wade Williams
24,476 Points

You don't need to create an age variable, the age variable will be created for you. You have your conditional statement, now you just need to set admitted to True.

admitted = None

if age >= 13:
    admitted = True

the second task is getting me. I've got admitted = None if age >= 13: admitted = True else: admitted = False

and now it's claiming task 1 won't pass, any ideas?

Wade Williams
Wade Williams
24,476 Points

I'm guessing you have an indentation error or other formatting error. I can't see the formatting of your code, but from your description our code matches and this passes.

admitted = None

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

Thanks Wade! I cleaned up the indentation a little bit and now it's passing!