python - I want to ask about this exceptionquestion -


here code

class e3exception(exception):   pass  class e3oddexception(e3exception):   pass  def raiser (x):   if (int(x)%2==1):     raise e3oddexception   elif (int(x)%2==0):     x=int(x)   elif (x=='csc148'):     raise e3exception('hi brian')   elif (isinstance(x, str)==true & isinstance(int(x), int)==false &   x!='csc148'):      raise valueerror   else:     raise typeerror     

i tried run raise(csc148) kept getting following error, know why?

traceback (most recent call last): file "<string>", line 1, in <fragment> builtins.typeerror: exceptions must derive baseexception 


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -