N = 100
table = list(range(N))
for i in range(2, int(N ** 0.5) + 1):
    if table[i]:
        for mult in range(i ** 2, N, i):
            table[mult] = False
primes = [p for p in table if p][1:]
primes
Python prime generator in one-line