title: Typecasting entries of a list within a list in Python
body: <p>I'm looking to typecast each entry of a list that is within another list in Python.</p>
  
  <p>I know <code>map</code> works for these sorts of cases:</p>
  
  <pre><code>list = map(int, list)
  </code></pre>
  
  <p>But this doesn't work cases such as this:</p>
  
  <pre><code>for entry in list:
      entry = map(int, entry)
  </code></pre>
  
  <p>The entries are typecast within the loop, but when the loop ends, somehow, each entry reverts to its original type.</p>
  
  <p>Say I have a list like this: <code>[1, 2, 3, 4]</code>. I can convert each entry to a string like this: <code>new_list = map(str, [1, 2, 3, 4])</code> to give me <code>['1', '2', '3', '4']</code>. But that doesn't work with lists within another list. <code>[ [1, 2], [3, 4] ]</code> won't convert to a string using this same method.</p>