Question: I'm trying to generate a certain number(input) of prime numbers, only using "while" "for" and "If",etc statements. for example, if I input "8", the program should return 8 prime numbers 2,3,5,7,11,...and so on. 

below is my code, but it only seems to give me 2 and 3, no matter what number I input. 

Thank you so much for all your help!

```
num=input("enter the number of prime numbers needed:")
if num=='0' or num=="" or int(num)<0:
    print("No data ^^")
else:
    num=int(num)
    i=2; N=3; prm=True
    print(2); count=1
    while(True):
        if count==num:
            break
        i=2
        while i<N:
            if N%i==0:
                prm=False
                break
            else:
                i+=1
        if prm==True:
            print(N); count+=1
        N+=1

```

Answer: 
you just forgot to add `prm = true` at the end of the loop:

```
num=input("enter the number of prime numbers needed:")
if num=='0' or num=="" or int(num)<0:
    print("No data ^^")
else:
    num=int(num)
    i=2; N=3; prm=True
    print(2); count=1
    while(True):
        if count==num:
            break
        i=2
        while i<N:
            if N%i==0:
                prm=False
                break
            else:
                i+=1
        if prm==True:
            print(N); count+=1
        N+=1
        prm=True

```

Btw. The Code you wrote isn't the cleanest, maybe you should work on that
The intended logic is that for each candidate value, we start out assuming it's prime, then do each check to find out if it isn't.

Therefore, `prm = True` should be set at the beginning of each of the loops used to test a candidate value. In the existing code, it's set only once, outside the `while` loop. Thus, the first time that a composite value is found, `prm` gets set to `False` - and can never be set `True` again, therefore no more primes are detected.