mmc problem in Python

0

In a problem I asked to make the mmc from 1 to 20, so I wrote this code:

b=20

while b>0:
 if all(b % x ==0 for x in range(1,21)):
   print(b)
   break
 if any(b % x !=0 for x in range(1,21)):
   b +=20

However, the program only keeps running and does not provide the answer. Where did I go wrong?

    
asked by anonymous 13.10.2018 / 16:27

0 answers