How to rewrite a pair of nested for-loops as a comprehensive list expression
<p>I'd like to make my code to be more Pythonic.</p>

<p>Having a simple list of lists like</p>

<pre><code>numbers = [[1, 2], [3, 4, 5]]
</code></pre>

<p>I want to do this:</p>

<pre><code>mylist = []
for sublist in numbers:
  for number in sublist:
      mylist.append(number)
</code></pre>

<p>But in a single line, using a comprehensive list definition:</p>

<pre><code>mylist = [ number for number in  sublist for sublist in numbers] 
</code></pre>

<p>However the result I get is [3, 3, 4, 4, 5, 5]</p>

<p>What am I doing wrong? Thanks in advance!</p>
