Skip to content

Commit ba441dd

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 29e9047 commit ba441dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

maths/is_perfect_number.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ def is_perfect_number(n: int) -> bool:
22
"""
33
Check if a number is a Perfect Number.
44
5-
A perfect number is a positive integer that is equal to the sum
5+
A perfect number is a positive integer that is equal to the sum
66
of its positive divisors, excluding the number itself.
77
88
Example:
@@ -14,7 +14,7 @@ def is_perfect_number(n: int) -> bool:
1414
return False
1515

1616
total = 1 # 1 is always a divisor
17-
for i in range(2, int(n ** 0.5) + 1):
17+
for i in range(2, int(n**0.5) + 1):
1818
if n % i == 0:
1919
total += i
2020
if i != n // i:
@@ -24,6 +24,6 @@ def is_perfect_number(n: int) -> bool:
2424

2525

2626
if __name__ == "__main__":
27-
print(is_perfect_number(6)) # True
27+
print(is_perfect_number(6)) # True
2828
print(is_perfect_number(28)) # True
2929
print(is_perfect_number(10)) # False

0 commit comments

Comments
 (0)