title: How can I create code that will show prime numbers correctly in Python?
body: <p>A prime number is a number that is only evenly divisible by itself and 1.
  For example, the number 5 is prime because it can only be evenly divided by 1
  and 5. The number 6, however, is not prime because it can be divided evenly
  by 2 and 3.</p>
  <p>Write a Boolean function named is_prime which takes an integer as an argument
  and returns true if the argument is a prime number, or false otherwise. Use
  the function in a program that prompts the user to enter a number and then
  prints whether the number is prime.</p>
  <p>This is the PYTHON code I have put in, but it tells me that it is wrong. I've tried but can't get it.</p>
  <pre><code>if num &gt; 1:
      for i in range(2,num):
          if (num % i) == 0:
              print(num,&quot;is not a prime number&quot;)
              print(i,&quot;times&quot;,num//i,&quot;is&quot;,num)
          break
      else:
          print(num,&quot;is a prime number&quot;)
      else:
          print(num,&quot;is not a prime number&quot;)
  </code></pre>