143 is 11*13 so its not prime.
Your code would count it as prime because you only check if it can be divided by the first 5 prime numbers.
To resolve your doubt I just multiplied the next to primes 11 and 13.
Hope it helps.
By the way your code is also wrong because it only increments "i" when it match the condition, so when it s always checking:
if 11%2==0 or 11%3==0 or 11%5==0 or 11%7==0:
Solution for your code (doesn't calculate the 1000th prime):
count=5 #Nth prime number
i=10 #number to be checked
while (count!=1000): #until its not 1000th
if i%2==0 or i%3==0 or i%5==0 or i%7==0: #to check non prime
pass #next number initialized
else: #for prime
count=count+1 #move to next position
i=i+1
if count==1000: #if is 1000th position
print i-1," is 1000th prime." #print prime
Solution for your problem:
def is_prime(n):
if n == 2 or n == 3: return True
if n < 2 or n%2 == 0: return False
if n < 9: return True
if n%3 == 0: return False
r = int(n**0.5)
f = 5
while f <= r:
if n%f == 0: return False
if n%(f+2) == 0: return False
f +=6
return True
count=5 #Nth prime number
i=10 #number to be checked
while (count!=8): #until its not 1000th
if not is_prime(i): #to check non prime
pass #next number initialized
else: #for prime
count=count+1 #move to next position
i=i+1
if count==8: #if is 1000th position
print i-1," is 1000th prime." #print prime
Function is_prime(n) got from isPrime Function for Python Language