num = int(input("Please input a number: ")) for i in range(2, num): for j in range(2, i): if (i % j == 0): break if (i == j + 1): print(i)
[formación] Pitón – número primo
Deja tu comentario
num = int(input("Please input a number: ")) for i in range(2, num): for j in range(2, i): if (i % j == 0): break if (i == j + 1): print(i)