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 trialSubramanian K
3,103 PointsUnorderable 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.
admitted = None
age = 13
if age>admitted:
print("true")
5 Answers
Ted Dunn
43,783 PointsThe 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
Iain Simmons
Treehouse Moderator 32,305 PointsYou'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
3,103 PointsThanks @Ted Dunn and @Iain Simmons It works.
Nate Paul
11,885 Pointsadmitted = None age = 13
if age >= 13: admitted = True
Gonzalo Torres del Fierro
Courses Plus Student 16,751 Pointsbe aware of indentation too, it is possible that the code does not work just for that (use tab key)