title: Checking if a number is prime in Python
body: <p>I have written the following code, which should check if the entered number is a prime number or not, but there is an issue I couldn't get through:</p>
  <pre><code>def main():
      n = input(&quot;Please enter a number:&quot;)
      is_prime(n)
  
  def is_prime(a):
      x = True
      for i in (2, a):
              while x:
                 if a%i == 0:
                     x = False
                 else:
                     x = True
  
  
      if x:
          print(&quot;prime&quot;)
      else:
          print(&quot;not prime&quot;)
  
  main()
  </code></pre>
  <p>If the entered number is not a prime number, it displays &quot;not prime&quot;, as it is supposed to, but if the number is a prime number, it doesn't display anything. How can I fix this?</p>