exceptions added for user input

This commit is contained in:
2019-08-02 18:54:27 +02:00
parent 0cb5e2f73f
commit caf650eaef
4 changed files with 91 additions and 33 deletions
+22
View File
@@ -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