title: "TypeError: not all arguments converted during string formatting" when trying to find even numbers
body: <p>I am getting this error on Python 3, <code>TypeError: not all arguments converted during string formatting</code>. I know this is due to the string starting with <code>&quot;[&quot;</code> but the problem I'm solving has this as the input string <code>'[1, 2, 3, 4, 5, 6, 7, 8, 9]'</code> and the task is to find the even numbers on Python 3. Any help would be much appreciated.</p>
  <pre><code>def is_even_num(l):
    enum = []
    for n in l:
       if n % 2 == 0:
         enum.append(n)
    return enum
  print(is_even_num('[1, 2, 3, 4, 5, 6, 7, 8, 9]'))
  </code></pre>
  <pre class="lang-none prettyprint-override"><code>TypeError: not all arguments converted during string formatting
  </code></pre>
  <p>If I try <code>int(n)</code>, I get this error</p>
  <pre class="lang-none prettyprint-override"><code>ValueError: invalid literal for int() with base 10: '['
  </code></pre>
  <h3>Edit 1:</h3>
  <p>A similar problem I am facing due to the input being a STRING</p>
  <p>Python Exercise: Sort a tuple by its float element</p>
  <pre><code>price = &quot;[('item1', '12.20'), ('item2', '15.10'), ('item3', '24.5')]&quot; 
  print( sorted(price, key=lambda x: float(x[1]), reverse=True)) 
  </code></pre>
  <pre class="lang-none prettyprint-override"><code>IndexError: string index out of range 
  </code></pre>
  <p>Here 'Price' is a string and the problem is to Sort a tuple by its float element</p>
  <ol start="2">
  <li><p>Program to transpose a matrix using a nested loop</p>
  <pre><code>y = &quot;[[1,2,3,4],[4,5,6,7]]&quot;
  result = [[0,0],
    [0,0],
    [0,0],
    [0,0]]
  
  #iterate through rows
  for i in range(len(X)):
  # iterate through columns
      for j in range(len(X[0])):
          result[j][i] = X[i][j]
  for r in result:
      print(r)
  </code></pre>
  </li>
  </ol>
  <pre class="lang-none prettyprint-override"><code>IndexError: list index out of range
  </code></pre>
  <p>I am getting this same type of problem again, the matrix has been input as a STRING.</p>