lists | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

lists

Could somebody explain me this piece of code if it is correct and how? Thanks L = [] nmax = 30 for n in range(2, nmax): for factor in L: if n % factor == 0: break else: L.append(n) print(L)

22nd May 2017, 1:45 AM
juan ferrer
0 Answers