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

Subramanian K
Subramanian K
3,103 Points

Unorderable type Error. NoneType()<int()

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
age = 13
if age>admitted:
    print("true")

5 Answers

The challenge states that a variable called age will be created for you so you do not need to create and initialize the variable age = 13.

The challenge is asking you check if age is greater than 13; if this is true, change admitted to True.

if age > 13:
    admitted = True

You're trying to compare an integer to None, which you can't do.

You don't need to set the age, it says that that will be done for you.

You just need to check if the age is greater than or equal to 13.

Then set admitted to True if that condition matches.

Subramanian K
Subramanian K
3,103 Points

Thanks @Ted Dunn and @Iain Simmons It works.

Nate Paul
Nate Paul
11,885 Points

admitted = None age = 13

if age >= 13: admitted = True

Gonzalo Torres del Fierro
PLUS
Gonzalo Torres del Fierro
Courses Plus Student 16,751 Points

be aware of indentation too, it is possible that the code does not work just for that (use tab key)