I'm a beginner in python my code takes so much time just in finding the primes bellow 2 million he works fine with numbers like thousands but a million is a big number, anyone has an idea about whats can I do thank you in advance:
arr = list()
for i in range(2, 200000):
for j in range(2, i + 1):
if i % j == 0 and i == j:
arr.append(i)
elif i % j == 0 and i != j:
break
else:
continue
print(arr)