Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Basic use of modulus solution in Clear category for Find Remainder by tramcrazy
def find_remainder(dividend: int, divisor: int) -> int:
return dividend % divisor # use modulus to find remainder
print("Example:")
print(find_remainder(3, 2))
# These "asserts" are used for self-checking
assert find_remainder(10, 3) == 1
assert find_remainder(14, 4) == 2
assert find_remainder(27, 4) == 3
assert find_remainder(10, 5) == 0
assert find_remainder(10, 1) == 0
assert find_remainder(5, 7) == 5
assert find_remainder(7, 5) == 2
print("The mission is done! Click 'Check Solution' to earn rewards!")
March 15, 2024