Classify by Divisors

A number can be classified by the sum of its proper divisors, which are its positive divisors excluding the number itself. The function classify receives number and returns perfect if the sum equals the number, abundant if the sum is greater, and deficient if the sum is smaller. If number is less than or equal to 0, raise ValueError.

Примеры

Ввод
6
Вывод
"perfect"
Ввод
28
Вывод
"perfect"
Ввод
12
Вывод
"abundant"

Нужно реализовать

def classify(number: int) -> str:

Теги

math
PostgreSQLv16

Itt jelenik meg a kód futtatásának eredménye

Visible tests
1
Input
6
Expected"perfect"
2
Input
28
Expected"perfect"
3
Input
12
Expected"abundant"
4
Input
8
Expected"deficient"
5
Input
1
Expected"deficient"
6
Input
33550336
Expected"perfect"
Focus radio
Paused · SomaFM · Fluid