From 4111902b6a3f791cfbd7e228779bd28c800b54ba Mon Sep 17 00:00:00 2001 From: yashkumarjha12 <72943344+yashkumarjha12@users.noreply.github.com> Date: Thu, 6 Oct 2022 12:24:57 +0530 Subject: [PATCH] Create exception handling.py --- Python/exception handling.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Python/exception handling.py 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")