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

Gregory Waldrip
Gregory Waldrip
895 Points

Stuck on question, how to change admitted=None to become true

I have been struggling with this question for sometime an can't get it to work correctly. The problem I am having is admitted=None which i believe none = false if I am correct, I have tried creating a variable name age ie. age = 20 then and if statement if age > 13 print true the error message i cant seem to get around is when i try to manipulate the original variable of admitted it is stating you cant add or subtract None from and integer or float. I understand that but I am not sure how to get around this question, I have been stuck on it for over a day. Any help would be greatly appreciated.

Thanks Greg

if age >13:

2 Answers

Greg Kaleka
Greg Kaleka
39,021 Points

Hi Greg!

You're doing everything right, except that all you're doing if the person is old enough is printing "True" to the console - that won't change admitted!

Also, you don't need to set age to anything. Kenneth says he is going to create a variable age, so drop that line and skip straight to the if statement.

Instead don't print anything, and just go ahead and just set admitted equal to True. You can do it :blush:

Cheers :beers:


Gregory Waldrip
Gregory Waldrip
895 Points

Thanks, Greg I really appreciate your help with it.