feat(solution): problem #5
parent
617c6b777c
commit
d110137e41
|
|
@ -0,0 +1,15 @@
|
||||||
|
def evenlyDivisible(num):
|
||||||
|
for i in range(1, 21):
|
||||||
|
if num % i != 0:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
multipleFound = False
|
||||||
|
multiple = 20
|
||||||
|
|
||||||
|
while multipleFound == False:
|
||||||
|
multipleFound = evenlyDivisible(multiple)
|
||||||
|
if multipleFound == False:
|
||||||
|
multiple += 1
|
||||||
|
|
||||||
|
print("The smallest positive number that is evenly divisible by all of the numbers from 1 to 20 is: " + str(multiple))
|
||||||
Loading…
Reference in New Issue