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 trialJohn Conner
Courses Plus Student 1,360 PointsThis seems pretty straight forward, but the variable admitted passes first check, but adding the second piece ...
of code reveals an error about the first task no longer pass.
the is my code admitted = None if age >= 13: admitted = True else admitted = False
admitted = None
if age >= 13:
admitted = 1
else admitted = 0
2 Answers
Steven Parker
231,271 PointsThe code automatically copied in from your challenge is different from what you added yourself. But the issues they (might) have in common (since one isn't formatted it's hard to be sure):
- an "else" statement should start in the same column as the matching "if"
- an "else" should be followed by a colon (:)
- everything that the else controls should be on following lines and indented more than the "else" itself
John Conner
Courses Plus Student 1,360 PointsThank you for the little syntax clean up.