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
PostgreSQLv16

Her vises resultatet af din kode

Visible tests
1
Input
12
Expected[2,3,4,6]
2
Input
25
Expected[5]
3
Input
13
Expected"prime"
4
Input
3
Expected"prime"
5
Input
15
Expected[3,5]
6
Input
24
Expected[2,3,4,6,8,12]
Focus radio
Paused · SomaFM · Fluid