I am new to the programming world. I was just writing this code in python to generate N prime numbers. User should input the value for N which is the total number of prime n
Using generator expressions to create a sequence of all primes and slice the 100th out of that.
from itertools import count, islice
primes = (n for n in count(2) if all(n % d for d in range(2, n)))
print("100th prime is %d" % next(islice(primes, 99, 100)))