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 trialPeckeday Slossar
1,069 PointsStep 2
Added else statement and now Task 1 is not passing
admitted = None
if age >= 13:
admitted = True
else:
admitted = False
2 Answers
Michael Hulet
47,913 PointsIn Python, indentation is very important. It's how the language distinguishes what code goes with what other code. An else
statement needs a matching if
to go with, which means that they'll have to be indented the same amount for Python to know that they go together, like this:
if some_boolean:
pass
else:
pass # This else goes with the above if
Ari Misha
19,323 PointsHiya Peckeday! You have identation issues in your code. Your "else" should be indented with your "if" statement. Do that and your code will pass with flying colors. (: