We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Errors and Exceptions
- Exceptions
- Discussions
Exceptions
Exceptions
+ 0 comments num_tests = int(input()) for _ in range(num_tests): try: a, b = map(int, input().split()) result = a // b print(result) except ZeroDivisionError as e: print("Error Code:", e) except ValueError as e: print("Error Code:", e)
+ 1 comment When you do 3/0, the ZeroDivisionError is "Division by Zero" When you do 3//0, the ZeroDivisionError is "integer division or modulo by zero"
+ 0 comments PyPy 3
t = int(input()) for i in range (t): try: a, b= input().split() print(int (a)// int (b)) except (ZeroDivisionError, ValueError) as e: print("Error Code:",e)
+ 0 comments Python 3
T = int(input()) for i in range(T): try: a, b = map(int,input().split()) print(a//b) except (ZeroDivisionError, ValueError) as e: print('Error Code:', e)
+ 0 comments t = int(input()) for i in range(t): try: a, b = input().split() print(int(a)//int(b)) except (ZeroDivisionError, ValueError) as err: print("Error Code:",err)
Load more conversations
Sort 324 Discussions, By:
Please Login in order to post a comment