This code does not work. Please tell what the error is....
class Error(Exception):
def __init__(self,mssg):
self.mssg = mssg
class InputError(Error):
def __init__(self,val):
super("Input Error")
print val
Now I write in other part of my program
a = raw_input("Enter a number from 0-9: ")
if (ord(a)>47 and ord(a)<58):
pass
else:
raise InputError(a)
Now when I pass 'a' I get super expected a type but got a string
I just want to pass that message to the base class and display it along with the wrong value.
What am I doing wrong here