Ver originaldef es_primo(n): for i in range(2, n): if not (n % i): return True return False lista = [] for i in range(2, num + 1): es_primo(i) and lista.append(i)