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 trialtraolach trewhella
Courses Plus Student 835 Pointssome help on the if statement.
so do i use the age var cause on the line of instructions is said i'm going to create a var named age what did i miss and what is this function if going to do as far as w'righting code or making a web sit
admitted = None
admitted = True
if age > 13
1 Answer
Jennifer Nordell
Treehouse TeacherYou're very close here! As you know there are many services that require you to be 13 years or older to use. Mostly American-based. Examples are Facebook, Steam, and the creation of an Apple ID. All we're asking here is if the user is thirteen years or older. But they made the age variable for you in advance outside of your code. And the guys and gals at Treehouse are going to send values into the age variable to test it. So your code should work for any value they send. Here's the code you need:
admitted = None
if age >= 13:
admitted = True
Here we start by setting admitted to None. Then we check the age. If the person is age thirteen or older we set admitted to True. This translates into us allowing them access to our hypothetical services somewhere else in our code.
Hope that helps!
traolach trewhella
Courses Plus Student 835 Pointstraolach trewhella
Courses Plus Student 835 Pointsthis is the best! thanks your doing a great job aat explaining and now this makes sense!!!