python-euler/solutions/005/smallestmultiple.py

15 lines
409 B
Python
Raw Permalink Normal View History

2023-07-31 12:45:06 -04:00
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))