class Solution(object):
def isThree(self, n):
"""
:type n: int
:rtype: bool
"""
count,i = 0,1
while i**2 <= n:
if n % i == 0:
if i != n // i:
count += 2
else:
count += 1
if count > 3:
return False
i+=1
return count == 3
python