- Handling invalid input error
- Entering valid Input
- Entering Invalid Input
- ZeroDivisionError
- ZeroDivisionError - Error Class & Error Message
try:
number = int(input("Please Enter a Number: "))
print(number)
except:
print("Invalid Input")
try:
number = int(input("Please Enter a Number: "))
print(number)
except:
print("Invalid Input")
try:
x = 10 / 0
number = int(input("Please Enter a Number: "))
print(number)
except ZeroDivisionError as err:
print(err)
except ValueError:
print("Invalid Input")
try:
x = 1 / 0
except ZeroDivisionError as err:
print("Error class is: ", type(err))
print("Error message is:", err)