title: Prime number function returns true instead of false
body: <p>I'm currently learning Python with Codecademy. I am on exercise 6 called "is_prime". I wrote the function step by step from the instructions, but it returns True instead of False. Why?</p>
  
  <p>Instructions:</p>
  
  <p><a href="https://i.stack.imgur.com/k3MPU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k3MPU.png" alt="Instructions"></a></p>
  
  <p>My code:</p>
  
  <pre><code>def is_prime(x):             # step 1
      for n in range(2,x-1):   # step 2
          if (x % n) == 0:     # step 3
              return False
      else:                    # step 4
          return True
  </code></pre>
  
  <p>Error: Your function fails on is_prime(0). It returns True when it should return False.</p>