Sort by

recency

|

443 Discussions

|

  • + 0 comments

    Python 3

    for _ in range(int(input())):
        a,b = input().split(' ')
        
        try:
            print(int(a)//int(b))
        except ZeroDivisionError:
            print('Error Code: integer division or modulo by zero')
        except ValueError as e:
            print(f'Error Code: {e}')
            
    
  • + 0 comments

    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)

  • + 1 comment

    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)

                why this code isn't working i tried every possible different code but isn't not working why ?
    
    
    
                whe
    
  • + 0 comments
    n = int(input())
    for _ in range(n):
        try:
            a, b = map(int, input().split())
            x = int(a)/int(b)
            print(int(x))
        except ZeroDivisionError:
            print("Error Code: integer division or modulo by zero")
        except ValueError as e:
            print("Error Code:", e)
    
  • + 0 comments
    num_test_cases = int(input())
    
    for _ in range(num_test_cases):
        try:
            a, b = map(int, input().split())
            result = a // b
            print(result)
        except Exception as error:
            print(f"Error Code: {error}")