exceptions added for user input
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
class NotANumberException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class SubjectNotExistingException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class CategoryNotExistingException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class WrongCaseException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def convertible(string):
|
||||
try:
|
||||
float(string)
|
||||
return True
|
||||
except ValueError:
|
||||
raise NotANumberException
|
||||
Reference in New Issue
Block a user