Find Prime number with Python occurence=0 for num in range(2,1000): if all(num%i!=0 for i in range(2,num)): occurence=occurence+1 print (occurence)