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 trialAyaz Alam
564 PointsI am passing Task 1, but when i go to Task 2, it says Task 1 is not completed. why?
Task 1 :
admitted = None
age = 14
if age >= 13: admitted = True
Task 2 :
admitted = None
age = 14
if age >= 13: admitted = True else: admitted = False
admitted = None
age = 14
if age >= 13:
admitted = True
else:
admitted = False
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHey Ayaz,
When you get that error, it almost always means that you have introduced a syntax error in the current task you are working on, not the one that the error says is no longer passing... I know... a very misleading error.
Here, you have a couple of issues.
- The challenge didn't ask for you to declare an age variable, so the line
age = 14
needs to be deleted. - Your if/else statement has some indentation issues, and this is what is causing your "Bummer!" message. Your
else
statement should not be indented. When it is (as you have it, it is then inside of theif
statement.
Just delete that one line... fix up the indentation... and you'll be good to go.
Keep Coding! :)
Ayaz Alam
564 PointsAyaz Alam
564 PointsThanks! :)