mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-27 00:46:43 +00:00
Update sol1.py
This commit is contained in:
parent
c3b8c51822
commit
60ec25ef7a
@ -30,7 +30,9 @@ def count_divisors(n):
|
|||||||
for i in xrange(1, int(sqrt(n))+1):
|
for i in xrange(1, int(sqrt(n))+1):
|
||||||
if n%i == 0:
|
if n%i == 0:
|
||||||
nDivisors += 2
|
nDivisors += 2
|
||||||
|
#check if n is perfect square
|
||||||
|
if n**0.5 == int(n**0.5):
|
||||||
|
nDivisors -= 1
|
||||||
return nDivisors
|
return nDivisors
|
||||||
|
|
||||||
tNum = 1
|
tNum = 1
|
||||||
@ -43,4 +45,4 @@ while True:
|
|||||||
if count_divisors(tNum) > 500:
|
if count_divisors(tNum) > 500:
|
||||||
break
|
break
|
||||||
|
|
||||||
print(tNum)
|
print(tNum)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user