alternately appending elements from two lists
<p>I have three lists with elements :</p>

<pre><code>a = [[0,1],[2,3],...]
b = [[5,6],[7,8],...]

c = []
</code></pre>

<p>I want to append elements from <code>a</code> and <code>b</code> into <code>c</code> to get:</p>

<pre><code>c = [ [0,1],[5,6],[2,3],[7,8],.... ]
</code></pre>

<p>Basic approach:</p>

<pre><code>&gt;&gt;&gt; a = [[0,1],[2,3]]
&gt;&gt;&gt; b = [[5,6],[7,8]]
&gt;&gt;&gt; c = []
&gt;&gt;&gt; for pair in zip(a,b):
...   c.extend(pair)
... 
&gt;&gt;&gt; c
[[0, 1], [5, 6], [2, 3], [7, 8]]
&gt;&gt;&gt; 
</code></pre>

<p>This breaks if the lengths aren't equal. But you can deal with that case as an exercise.</p>

python list append