Sha256: 3f773a403f19d61e43c58337b4e3572e14156d3398210eedd519d7cfb19b5d6a

Contents?: true

Size: 227 Bytes

Versions: 396

Compression:

Stored size: 227 Bytes

Contents

def prime_factors(number):
    factors = []
    divisor = 2
    while number > 1:
        while number % divisor == 0:
            factors.append(divisor)
            number /= divisor

        divisor += 1

    return factors

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.179 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.178 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.177 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.176 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.175 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.174 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.173 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.172 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.171 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.170 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.169 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.167 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.166 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.165 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.164 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.163 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.162 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.161 tracks/python/exercises/prime-factors/example.py
trackler-2.2.1.160 tracks/python/exercises/prime-factors/example.py