title: Python 3: Making my code find prime numbers faster
body: <p>I have to calculate the 10001th prime numbers. My code is working, but it takes about 30 minutes for it to find the correct prime number. I am looking for some help to make this code run faster, I guess there is a faster way. I just started with Python, so I am partially just missing the knowlegde I guess.</p>
  
  <pre><code>number = 1
  a = []
  length = len(a)
  d= 0
  
  while length &lt; 10001:
      if number == 1 or number == 2:
          a.append(number)
      for getal in range(2, number):
          if number % getal == 0:
              d = 0
              break
          else:
              d = 1
      if d &gt; 0:
          a.append(number)
      length = len(a)
      print(length)
      number += 1
  
  print(a[10000]) 
  </code></pre>