Answers for "the first n prime numbers"

0

the first n prime numbers

def prime_numbers(n):
    i = 2
    while i <= n + 1:
        if i % i == 0 and i % 2 != 0 and i % 3 != 0 and i % 5 != 0 and i % 7 != 0 \
                or i == 2 or i == 3 or i == 5 or i == 7:
            print(i)
            i = i + 1
        else:
            i = i + 1
            n = n + 1


prime_numbers(25)
Posted by: Guest on October-04-2021

Code answers related to "the first n prime numbers"

Python Answers by Framework

Browse Popular Code Answers by Language