title: What is the flaw with my logic in a python function for checking primes?
body: <p>I'm relatively new to Python and trying to build a function to check primes because I thought it would be a good starter project, but my code returns everything as a prime, so it's obviously gone wrong. I get this is an inefficient way to do it, but I want to understand how to do it the long way first. Here's my code so far:</p>
  
  <pre><code>def Prime(n):
      if n == 1 or n == 2 or n == 3:
          print("This number is prime.")
      else:
          i = n - 1
          while i &gt; 0:
              if n % i == 0:
                  break
                  print("This number is not prime.")
              else:
                  i = i - 1
              print("This number is prime.")
  
  def Main():
      n = int(input("What is the number you'd like to check?"))
      Prime(n)
      answer2 = input("Thank you for using the prime program.")
  
  Main()
  </code></pre>