title: How to convert list of intable strings to int
body: <p>In Python, I want to convert a list of strings:</p>
  
  <pre><code>l = ['sam','1','dad','21']
  </code></pre>
  
  <p>and convert the integers to integer types like this:</p>
  
  <pre><code>t = ['sam',1,'dad',21]
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>t = [map(int, x) for x in l]
  </code></pre>
  
  <p>but is showing an error.</p>
  
  <p>How could I convert all <em>intable</em> strings in a list to int, leaving other elements as strings?</p>
  
  <p>My list might be multi-dimensional. A method which works for a generic list would be preferable:</p>
  
  <p><code>l=[['aa','2'],['bb','3']]</code></p>