title: How to unnest a nested list
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python">Making a flat list out of list of lists in Python</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to find an easy way to turn a multi dimensional (nested) python list into a single list, that contains all the elements of sub lists.</p>
  
  <p>For example:</p>
  
  <pre><code>A = [[1,2,3,4,5]]
  </code></pre>
  
  <p>turns to</p>
  
  <pre><code>A = [1,2,3,4,5]
  </code></pre>
  
  <p>or</p>
  
  <pre><code>A = [[1,2], [3,4]]
  </code></pre>
  
  <p>turns to</p>
  
  <pre><code>A = [1,2,3,4]
  </code></pre>