Divisible by Both
Divisibility checks are common in filters, games, and simple math rules. Write is_divisible, which checks whether n divides evenly by both x and y. Return True if both divisions have no remainder; otherwise return False.
Примеры
Ввод
3, 1, 3Вывод
TrueВвод
12, 2, 6Вывод
TrueВвод
100, 5, 3Вывод
FalseНужно реализовать
def is_divisible(n: int, x: int, y: int) -> bool:
Теги
math
Inicia sesión para ver tu historial de envíos
Iniciar sesiónInicia sesión para usar el AI Mentor
Iniciar sesiónVisible tests
1
Input
3, 1, 3Expected
True2
Input
12, 2, 6Expected
True3
Input
100, 5, 3Expected
False4
Input
12, 7, 5Expected
False5
Input
1000, 10, 100Expected
True6
Input
12, 2, 1Expected
TrueFocus radio
Paused · SomaFM · Fluid