Answer to Question #293762 in Python for Jaber1234

Question #293762

Write a method multiple() that determines, for a pair of integers, whether the second integer is a multiple of the first. The method should take two integer arguments and return true if the second is a multiple of the first and false otherwise. [Hint: Use the remainder operator “Modulo”.] Incorporate this method into an application main() that inputs a series of pairs of integers (one pair at a time) and determines whether the second value in each pair is a multiple of the first.


1
Expert's answer
2022-02-04T01:44:46-0500
def multiple(num1, num2):
    return num1 % num2 == 0

number1, number2 = [int(i) for i in input().split()]
print(multiple(number1, number2))

Sample input:

15 5

Sample output

True


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS