From 3b35c27434d1e920d1eef171ae79b87830784e31 Mon Sep 17 00:00:00 2001 From: pm bhatiya <61078575+pmbhatiya@users.noreply.github.com> Date: Wed, 1 Apr 2020 08:35:15 +0530 Subject: [PATCH] Add files via upload --- Exceptions.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Exceptions.py diff --git a/Exceptions.py b/Exceptions.py new file mode 100644 index 0000000..a766a66 --- /dev/null +++ b/Exceptions.py @@ -0,0 +1,13 @@ +# Python Exceptions HackerRank solution + +N=int(input()) +for i in range(N): + try: + a,b=map(int,input().split()) + try: + print(int(a//b)) + except ZeroDivisionError as e1: + print("Error Code:",e1) + except ValueError as e: + print("Error Code:",e) + \ No newline at end of file