# Write a function called next_prime, which returns a generator that will yield
# an unlimited number of primes, starting from the first prime (2)
#
# <p>Recall that a prime number is any whole number that has exactly two divisors:
# one and the number itself. The first few primes are 2, 3, 5, 7, 11, ... .</p>
'''
primes = next_prime()
[next(primes) for i in range(25)]
# [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
'''
def next_prime():
    num = 2
    while True:
        if not any((num % i == 0 for i in range(2, num))):
            yield num
        num +=1

primes = next_prime()
print([next(primes) for i in range(25)])
