title: Modifying nested lists
body: <p>How to handle nested lists in Python? I am having problem figuring out the syntax. Like example:</p>
  
  <pre><code>&gt;&gt;&gt; l = [[1, 2, 3], [5, 6, 7]]
  </code></pre>
  
  <p>I want to square all the elements in this list. I tried:</p>
  
  <pre><code>[m*m for m in l]
  </code></pre>
  
  <p>But that doesn't work and throws up:</p>
  
  <blockquote>
    <p>TypeError: can't multiply sequence by
    non-int of type 'list' </p>
  </blockquote>
  
  <p>because of the nested lists I guess?</p>
  
  <p>How do I fix this?</p>