diff --git a/listgame.py b/listgame.py new file mode 100644 index 0000000..9e4025c --- /dev/null +++ b/listgame.py @@ -0,0 +1,19 @@ +import sys + +x = int(sys.stdin.readline()) + +def prime_factors(n): + """Returns all the prime factors of a positive integer""" + factors = [] + d = 2 + while n > 1: + while n % d == 0: + factors.append(d) + n /= d + d = d + 1 + if d*d > n: + if n > 1: factors.append(n) + break + return factors + +print(len(prime_factors(x)))