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 trialJack Westhoven
553 PointsA question to the Treehouse staff members
Dear Treehouse staff, It seems as if the "elif" statement in python is no longer working. when I try, it says invalid syntax. I use the examples from the questions to make sure it didnt work, and I was correct. Please help.
admitted = None
Steven Parker
231,269 PointsIt doesn't look like you've written any code yet. In particular, there's no "elif" in your code above (and, you also don't need one for that challenge).
What is the actual code that caused the error?
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsI've verified that an elif
is syntactically allowable. The issue with this challenge is it's explicitly looking for an else
not an elif
in the solution.
Perhaps you're using the form:
if arg >= 50:
result = True
elif arg < 50:
result = False
Since the second condition is always True
if the first condition is False
, this can be simplified to:
if arg >= 50:
result = True
else:
result = False
Jack Westhoven
553 PointsJack Westhoven
553 Pointsthis error is in 3.5.0