mirror of
https://github.com/Xevion/exercism.git
synced 2025-12-11 12:07:15 -06:00
spiral matrix and prime factors exercise
This commit is contained in:
8
python/prime-factors/prime_factors.py
Normal file
8
python/prime-factors/prime_factors.py
Normal file
@@ -0,0 +1,8 @@
|
||||
def factors(value):
|
||||
factors, n = [], 2
|
||||
while value > 1:
|
||||
while value % n == 0:
|
||||
factors.append(n)
|
||||
value /= n
|
||||
n += 1
|
||||
return factors
|
||||
Reference in New Issue
Block a user