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 trialMariya Shklyar
1,022 PointsHow do I set the variable to True? Should I use bool(), or bool function is just for checking if it is true?
admitted = None if age >= 13:
I tried admitted is None, but that is wrong.
When responding please consider that I am beginner to programming.
admitted = None
if age >= 13:
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! Yes, the bool()
is a function that will return a boolean value based on what it's looking at. Here's some documentation on that: https://docs.python.org/2/library/functions.html
And might I say, so far you're doing great! You've understood the comparison and how to set up your if statement, so I'm just going to show you the tiny bit you're missing.
admitted = True
This will set the admitted variable to True. Don't forget to indent properly and good luck!
Alexander Davison
65,469 PointsThe question is asking for you to re-assign the variable to true if age is greater than or equal to 13. Try this:
admitted = None
if age >= 13:
admitted = True