You need to understand the range
function to get this behavior (and the essence of the program you used too).
range(7,1000,2)
gives you a list of integers starting from 7
which are less than 1000
and are computed by adding 2
to previous number - so the series of numbers that you get are 9
,11
,13
,15
.. and so on.
range(10,1000,2)
gives you a list of integers starting from 10
and which all will be divisible by 2
hence no primes in the list.
-- This program can help you --
primes = []
for i in range(1,100,2): # <==== change here - make sure first argument is odd
prime = True
for j in range(2,i-1):
if i % j == 0:
prime = False
break
if prime:
primes.append(i)
print primes