easy +5 pts

Is a multiple of both

Check if a number is divisible by both given divisors.

Write a function `is_multiple_of_both(number, a, b)` that returns `True` if `number` is a multiple of both `a` and `b`, and `False` otherwise. - `number`, `a`, and `b` are integers. - All inputs are non-negative. - You may assume `a` and `b` are positive. Return a boolean value.

Constraints

0 <= number <= 10^6 1 <= a, b <= 10^3 Expected time complexity: O(1).

Example

>>> is_multiple_of_both(12, 3, 4)
True
>>> is_multiple_of_both(15, 3, 5)
True
>>> is_multiple_of_both(10, 3, 5)
False
>>> is_multiple_of_both(0, 7, 11)
True
5 points ~5 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Use the modulo operator `%` to check divisibility.
A number is a multiple of `d` when `number % d == 0`.
Combine both checks with `and`.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.