Divisors in Order
Divisors help you see which smaller factors can build a number. Write divisors, which takes an integer n greater than 1 and returns all divisors except 1 and n itself, in ascending order. If there are no such divisors, the number is prime, so return the string prime.
Примеры
Ввод
12Вывод
[2, 3, 4, 6]Ввод
25Вывод
[5]Ввод
13Вывод
"prime"Нужно реализовать
def divisors(n: int):
Теги
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
12Expected
[2,3,4,6]2
Input
25Expected
[5]3
Input
13Expected
"prime"4
Input
3Expected
"prime"5
Input
15Expected
[3,5]6
Input
24Expected
[2,3,4,6,8,12]Focus radio
Paused · SomaFM · Fluid