Couple more problems

This commit is contained in:
2016-02-05 21:54:01 -08:00
parent c80fb6f2a6
commit 73239e1c23
8 changed files with 229 additions and 0 deletions

25
problem_5.py Normal file
View File

@@ -0,0 +1,25 @@
# Smallest positive number that is evenly divisible by all of the numbers from 1 to 20
# Oh boy is this slow. But it works!
counter = 20
running = True
def check_divisor(number):
q = True
for i in range(1, 21):
if number % i != 0:
q = False
return q
while running:
if not check_divisor(counter):
counter += 20
else:
running = False
print(counter)