mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-30 16:31:08 +00:00
Merge branch 'patch-12' of git://github.com/SandersLin/Python
This commit is contained in:
commit
d555a492dc
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user