In this HackerRank Exceptions problem solution, we have given two values a and b. and we need to perform integer division and print a/b.

HackerRank Exceptions in python problem solution

HackerRank Exceptions problem solution

# Enter your code here. Read input from STDIN. Print output to STDOUT
T = int(raw_input())
for i in range(T):
        a, b = map(int, raw_input().rstrip().split(" "))
        print a / b
    except ZeroDivisionError as zeroDivisionError:
        print "Error Code:", zeroDivisionError
    except ValueError as valueError:
        print "Error Code:", valueError