Mod Divmod

Sort by

recency

|

361 Discussions

|

  • + 0 comments
    n1, n2 = int(input()), int(input())
    
    div, mod = divmod(n1, n2)
    
    print(f"{div}\n{mod}")
    
    print(divmod(n1, n2))
    
  • + 0 comments
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    a,b=int(input()), int(input())
    m,d=divmod(a,b)
    print(m)
    print(d)
    print(divmod(a,b))
    
  • + 0 comments
    a = int(input())
    b = int(input())
    
    result = divmod(a, b)
    print(result[0])
    print(result[1])
    print(result)
    
  • + 0 comments
    from __future__ import division
    a = int(input())
    b = int(input())
    
    print (a//b)
    print (a%b)
    print(divmod(a, b))
    

    all you need is to print them using the operators as done above.

  • + 0 comments

    x = int(input()) y = int(input()) def divmod(num,divisor): divided = num // divisor mod = num % divisor print(divided) print(mod) return (divided,mod) print(divmod(x,y))