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 trialAnthony Ferrero
2,533 PointsIf / Else
I am unable to get past this code challenge. I tried many things but it always reverts back to "Task 1 is no longer passing"
Anthony Ferrero
2,533 PointsSorry, I thought I checked the box to include it. The challenge is:
OK, one more. Add an else to your if. In the else, set admitted to False.
admitted = None
if age > 13:
admitted = True:
else admitted = False
Anthony Ferrero
2,533 PointsFor some reason it is not recognizing when I enter code with the "ticks" on the comment section, each on is on a different line.
2 Answers
Ken Alger
Treehouse TeacherAnthony;
Correct code, bad indentation. Isn't Python fun that way? Your else
statement needs to be at the same indent level as your if
statement.
Happy coding,
Ken
Anthony Ferrero
2,533 PointsGot it to work! Thank you!
Ken Alger
Treehouse TeacherKen Alger
Treehouse TeacherAnthony;
Please post the code you are using. That error is typical of a syntax error.
Ken