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
|
387 Discussions
|
Please Login in order to post a comment
is for loop inside any try block of code terminates if there any error occures ,even though we handle it by some exeption block of code
I have a doubt any one please clarify see the code try: T=int(input()) for i in range (T): a,b=int(input().split()) print(a//b) except ......: #some block of code except....:
some block of code
for i in range(n): try: a=list(input().split()) print(int(int(a[0])/int(a[1])))
a=int(input()) for i in range(a): try: b=input().split(" ") print(int(int(b[0])/int(b[1]))) except ZeroDivisionError as e: print("Error Code: integer division or modulo by zero")
except ValueError as e: print("Error Code:",e)