title: Python prime number calculator
body: <pre><code>prime = [2]
  while len(prime) &lt;= 1000:
      i=3
      a = 0
      for number in prime:
          testlist= []
          testlist.append(i%number)
      if 0 in testlist:
          i=i+1
      else:
          prime.append(i)
          i=i+1
  print(prime[999])
  </code></pre>
  
  <p>Trying to make a program that computes primes for online course. This program never ends, but I can't see an infinite loop in my code.</p>
  
  <p>A prime number is a number that can only be divided by exclusively one and itself.</p>
  
  <p>My logic is that if a number can be divided by prime numbers preceding it then it is not prime.</p>