Feb-20-2019, 07:16 PM
I am newbie to Python and tried to write a code to get smallest positive number that is evenly divisible by all of the numbers from 1 to 20. I used the script provided below. It is taking more time to get the result.
How can I tweak this code to get the result sooner.
How can I tweak this code to get the result sooner.
a=1 while True: n=0 for y in range(1,21): if a%y==0: n=n+1 if n==20: print(a) break else: a=a+1