title: TypeError: unsupported operand type(s) for %: 'NoneType' and 'int'
body: <pre><code>def prime(x):
      if (x == 0 or x % 2 == 0):
          return 0
      elif (x == 1):  
          return 1
      else:
          for y in range(x-1,0,-1):
              if (x % y == 0):
                  return 0
              else:
                  pass
          if (y == 1):
              return 1
  
  for x in range(1,20):
      if (prime(x)):
          print ("x:%d, prime YES") % (x)
      else:
          print ("x:%d, prime NO") % (x)
  </code></pre>
  
  <p>I'm starting experimenting Python and I can't understand what's wrong with my code... I'm getting:</p>
  
  <blockquote>
    <p>...    print ("x:%d, prime YES") % (x)<br>
    TypeError: unsupported operand type(s) for %: 'NoneType' and 'int'</p>
  </blockquote>