Mod Divmod

Sort by

recency

|

369 Discussions

|

  • + 0 comments
    a, b = int(input()), int(input())
    print(f"{a//b}\n{a%b}\n{divmod(a, b)}")
    
  • + 0 comments
    a = int(input())
    b = int(input())
    
    print(a // b, a % b, divmod(a, b), sep="\n")
    
  • + 0 comments

    a = int(input())

    b = int(input())

    result = divmod(a, b)

    print(result[0])

    print(result[1])

    print(result)

  • + 0 comments

    Here's my code

    res = divmod(*[int(input()) for _ in range(2)])
    print(*(list(res)+[res]), sep='\n')
    
  • + 0 comments
    import os
    
    a = int(input())
    b = int(input())
    
    print(a//b, a%b, divmod(a,b), sep=os.linesep)