title: Prime number function loop mistake
body: <p>I have been told that this code for finding a prime number is wrong. Could anyone explain why? It works for at least the first 100 numbers.</p>
  <pre><code>    if x&lt;2:
          return 'It is neither prime nor composite'
      elif x==2 or x==3:
          return 'It is a prime number'
      else:
          for i in range(2,int(x**0.5)+1):
              print(i)
              if x%i==0 :
                  
                  return 'It is not a prime number'
                  break
          else:
              return 'It is a prime number'
  </code></pre>