File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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
2626if __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
You can’t perform that action at this time.
0 commit comments