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

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

Hi,

I'm a bit stuck in here. Figure out what I've done wrong and what could I do to repair the error?

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

2 Answers

Steven Parker
Steven Parker
231,007 Points

Here's a few hints:

  • the challenge says it will create the variable age, so you don't need to
  • you should test if age is 13 or more, but your test checks if 13 is greater than None.
  • "13 or more" would be the same thing as "greater than or equal 13", so it needs a different comparison operator
  • if the test passes, you need to set admitted to True
  • you won't need to print anything
#you forgot to add the equal
#change the value of admitted to True
admitted = None
age = 13
if age >= 13:
    admitted =True
Steven Parker
Steven Parker
231,007 Points

:warning: Frank, you forgot my first hint.

You should not create or set the variable age. The challenge does that itself.

Thank you Steven, I really appreciate your answer.

Frank : Dude I really appreciate your answer as well....will take some notes of bought yours and Stevens answers. Happy coding!