Perfect Number Check
A perfect number is equal to the sum of its proper positive divisors. Proper divisors are the divisors of a number excluding the number itself: for 6, they are 1, 2, and 3. The function perfect receives number and returns True if it is perfect, otherwise False.
Примеры
Ввод
27Вывод
FalseВвод
28Вывод
TrueВвод
29Вывод
FalseНужно реализовать
def perfect(number: int) -> bool:
Теги
math
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit seVisible tests
1
Input
27Expected
False2
Input
28Expected
True3
Input
29Expected
False4
Input
6Expected
True5
Input
12Expected
False6
Input
496Expected
TrueFocus radio
Paused · SomaFM · Fluid