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
Sort by
recency
|
443 Discussions
|
Please Login in order to post a comment
Python 3
t = int(input("")) for i in range(1 , t +1): valor = input() separado = valor.split() a = separado[0] b = separado[1] try: a = int(a) b = int(b) divisao = a // b print(divisao) except Exception as e: print("Error Code:", e)
t=int(input()) #t var for testcases for _ in range(t): try: a,b=input().split(" ") # taking a , b values
print(int(a)//int(b))
except ZeroDivisionError as a: print("Error Code:",a) except ValueError as e: print("Error code:",e)