title: Python - unsupported operand type(s) for %: 'list' and 'int'
body: <p>I've had a look at other questions on stackoverflow but they are different and don't seem to apply to this question, so here goes. </p>
  
  <p>I've written a simple script that gives me a print out of every number between 1-49 and puts it into a list using the range function.</p>
  
  <p>Now I have defined a function to work out what numbers are odd and what numbers are even, here is my code:</p>
  
  <pre><code>def check(number):
      if number%2==0:
          print "Even Numbers:",(number)
      else:
          print "Odd Numbers:",(number)
  
  
  a = range(1,50)
  
  print a
  
  check(a)
  </code></pre>
  
  <p>I get the following error when I run the script:</p>
  
  <pre><code>unsupported operand type(s) for %: 'list' and 'int'
  </code></pre>
  
  <p>So I know that this means the % operator cannot doesn't support 'lists' or 'ints', but how can I fix it?</p>
  
  <p>I tried this:</p>
  
  <pre><code>def check(number):
      if number%2==0:
          print "Even Numbers:",(number)
      else:
          print "Odd Numbers:",(number)
  
  
  a = range(1,50)
  
  b = str(a)
  
  check(str(a))
  </code></pre>
  
  <p>But get the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "showEvenNumbers.py", line 12, in &lt;module&gt;
      check(str(a))
    File "showEvenNumbers.py", line 2, in check
      if number%2==0:
  TypeError: not all arguments converted during string formatting
  </code></pre>
  
  <p>So I'm a bit unsure what to do.</p>
  
  <p>Any help would be much appreciated.</p>