diff --git a/Python/exception handling.py b/Python/exception handling.py new file mode 100644 index 0000000..f2a5b52 --- /dev/null +++ b/Python/exception handling.py @@ -0,0 +1,15 @@ +try: + a = int(input("Enter a number: ")) + b = int(input("Enter another number: ")) + c = a/b + print(c) +except ZeroDivisionError: + print("Division by zero is not possible") +except ValueError: + print("Invalid input") +except Exception as e: + print(e) +else: + print("No exceptions") +finally: + print("This is finally block")