HackerRank Mod Divmod in python problem solution

In this HackerRank Set .intersection() Operation problem solution in python Read in two integers, a and b, and print three lines. The first line is the integer division a//b (While using Python2 remember to import division from __future__). The second line is the result of the modulo operator: a%b. The third line prints the divmod of a and b.

HackerRank Mod Divmod in python problem solution

HackerRank Mod Divmod in python problem solution

# Enter your code here. Read input from STDIN. Print output to STDOUT
from __future__ import division

a=int(raw_input())
b=int(raw_input())
print a//b
print divmod(a,b)[1]
print divmod(a,b)

Post a Comment

0 Comments