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

If else

I'm going to create a variable named age.

I need you to make an if condition that sets admitted to True if age is 13 or more

conditions.py
admitted = None
if(admitted) >= 13:
    print("True")

3 Answers

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

Hi Conary Beckford! I received your request for assistance. Right now, you're trying to check if the value of admitted is greater than or equal to 13, but you should be checking if the variable age is greater than or equal to 13. The parentheses around your in your if statement are causing a syntax error and should be removed, but again admitted should be changed to age. To be clear, the age variable will be created and assigned a number by Treehouse. This is not something you need to take care of yourself.

After you determine if age is greater than or equal to 13, you then need to set admitted to the boolean value of True. Instead, you are printing the string "True".

I think you can get it with these hints, but let me know if you're still stuck! :sparkles:

Still no luck:

admitted = None if age >= 13: print("True") else: print("False")

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

Again, you're not supposed to print anything. Take a look:

admitted = True

Give it another shot! :sparkles:

Thank you. That was great

I chose you to help me because from your profile you've accomplished alot. I hope to one day be as knowledgeable as yourself.