How can I check whether the inputted character is number or not and wanted to raise an error for the same in python?
class Error(Exception):
pass
class ValueTooSmallError(Error):
pass
class ValueTooLargeError(Error):
pass
class ValueError(Error):
pass
number = 10
while True:
try:
i_num = float(input("Enter a number: "))
if i_num < number:
raise ValueTooSmallError
elif i_num > number:
raise ValueTooLargeError
break
except ValueTooSmallError:
print("This value is too small, try again!")
print()
except ValueTooLargeError:
print("This value is too large, try again!")
print()
except ValueError: **`this error doesn't reflect`**
print("Input is not a number")
print()
print("Congratulations! You guessed it correctly.")
```