Home/Support/Support Forum/Iam getting default 'except:' must be last how can i fix the error and give me the necode the explanation?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Iam getting default 'except:' must be last how can i fix the error and give me the necode the explanation?

0 votes
class SIException(Exception):
def _init_(self,length,atleast):
Exception._init_(self)
self.length=length
self.atleast=atleast
try:
s=input("Enter something:")
if len(s)<3:
raise SIException(len(s),3)
except:
print("Why did you do an EOF on me?")
except EOFError:
print("SIException:The input was of length:%d,was expecting atleast:%d" %(SIException.length,SIException.atleast))
else:
print("No exception was raised")
asked Oct 20, 2017 in 3rd Party Python and API development in other Languages by SShankaR135 New to the Community (0 points)

Please log in or register to answer this question.

...