Sort by

recency

|

416 Discussions

|

  • + 0 comments
    T = int(input().strip())
    for i in range(T):
        try:
            a, b = input().strip().split()
            result = int(int(a) / int(b))
        except ZeroDivisionError as e:
            print(f"Error Code: integer division or modulo by zero")
        except ValueError as ve:
            print(f"Error Code: {ve}")
        else:
            print(result)
    
  • + 0 comments
    T = int(input())
    for i in range(T):
        try:
            nums = list(map(int, input().split()))
            a = nums[0]
            b = nums[1]
            div = a//b
        except ZeroDivisionError as e:
            print(f"Error Code: {e}")
        except ValueError as n:
            print(f"Error Code: {n}")
        else:
            print(div)
    
  • + 0 comments
    n = int(input()) 
    for i in range(n):
     try:
         a, b = input().split() 
         r = int(a) // int(b)
         print(r) 
     except ZeroDivisionError as e:
         print("Error Code: integer division or modulo by zero") 
     except ValueError as v:
         print("Error Code:", v)
    
  • + 2 comments

    my code :

    t = int(input())

    for _ in range(t): elements = input().split()

    try:
        r = int(elements[0]) / int(elements[1])
        print(int(r))
    except ZeroDivisionError as ze:
        print("Error Code: integer division or modulo by zero")
    except ValueError as ve:
        print(f"Error Code: {ve}")
    
  • + 0 comments

    n = int(input()) for _ in range(n): try: a, b = input().split() print(int(a) // int(b)) except ZeroDivisionError as e: print("Error Code:", e) except ValueError as e: print("Error Code:", e)