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 trialAlexander Pavlenko
654 PointsI don't understand what I'm doing wrong. i passed task 1 and added: "else: admitted = False"
Can't figure out how to complete Task 2
admitted = None
age = 16
if age >= 13:
admitted = True
else:
admitted = False
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! There are two small issues here. One is your indentation, and one is that you're overwriting what they're testing. The else
should be in line with the if
. They are making the age variable and testing a number and we don't get to know what it is. By setting the age yourself, you are writing over what they are testing. So, if I fix the indentation and remove the age = 16
, your code passes!
Hope this helps!
Alexander Pavlenko
654 PointsAlexander Pavlenko
654 PointsThanks a lot , Jennifer!All good now! Absence of line defining 'age' variable confused me:) And when i passed Task 1 i was falsely assured that everything there is correct:) Cheers!
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherIt happens! Going forward, it's a good idea to not do anything that the challenge doesn't explicitly ask for. Even if functional, it can cause the challenge to fail