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
Try using while loop to check the count, that is easy. Find the code snippet below :
i=1
count = 0;
x = int(input("Enter the number:\n"))
while (count < x):
c=0
for j in range (1, (i+1), 1):
a = i%j
if (a==0):
c = c+1
if (c==2):
print (i)
count = count+1
i=i+1