0
How to find all prime numbers in a set of { 1..100 }
?
PS: After finding certain numbers, I need store it in a result list (result = []
).
lista = []
result = []
cont = 0
for i in range(1, 1001):
lista.append(i)
for j in lista:
for i in range(1, 1001):
if j % i == 0:
cont += 1
if cont == 2:
result.append(j)
cont = 0
print(result)
Thanks for the help!
– Bruno Carvalho