Advanced array concatenation python
<p>Say I have four multi-dimensional arrays - </p>

<pre><code>a = [["a","a","a"],
    ["a","a","a"],
    ["a","a","a"]]
b = [["b","b","b"],
    ["b","b","b"],
    ["b","b","b"]]
c = [["c","c","c"],
    ["c","c","c"],
    ["c","c","c"]]
d = [["d","d","d"],
    ["d","d","d"],
    ["d","d","d"]]
</code></pre>

<p>and I want to combine them into a single array like</p>

<pre><code>total = [["a","a","a","b","b","b"],
        ["a","a","a","b","b","b"],
        ["a","a","a","b","b","b"], 
        ["c","c","c","d","d","d"],
        ["c","c","c","d","d","d"],
        ["c","c","c","d","d","d"]]
</code></pre>

<p>How would I do it?</p>

<p><em>I am doing it for  spelunky-style map generation</em></p>

<p>Maybe like this:</p>

<pre><code>top = list(x+y for x,y in zip(a,b))
bottom = list(x+y for x,y in zip(c,d))
total = top + bottom

for r in total: print(r)
</code></pre>

<p>Output:</p>

<pre><code>['a', 'a', 'a', 'b', 'b', 'b']
['a', 'a', 'a', 'b', 'b', 'b']
['a', 'a', 'a', 'b', 'b', 'b']
['c', 'c', 'c', 'd', 'd', 'd']
['c', 'c', 'c', 'd', 'd', 'd']
['c', 'c', 'c', 'd', 'd', 'd']
</code></pre>

python arrays pygame concatenation