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
Zaloguj się, aby zobaczyć historię rozwiązań
Zaloguj sięZaloguj się, aby korzystać z Mentora AI
Zaloguj sięVisible 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