ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 02 Apr 2016 16:50:45 +0200merge lists of listshttps://ask.sagemath.org/question/32956/merge-lists-of-lists/ I realize that if I have two lists, say
l1 = [1,2,3]
l2 = [4,5,6]
then I can join them via
l1 + l2
i.e. this gives [1,2,3,4,5,6].
I want to know how to do this when my list is not a list of numbers, but a list of matrices. I imagine it would be the same for a list of lists but I don't know how to do that either.
Sat, 02 Apr 2016 01:42:11 +0200https://ask.sagemath.org/question/32956/merge-lists-of-lists/Answer by nbruin for <p>I realize that if I have two lists, say</p>
<pre><code>l1 = [1,2,3]
l2 = [4,5,6]
</code></pre>
<p>then I can join them via</p>
<pre><code>l1 + l2
</code></pre>
<p>i.e. this gives [1,2,3,4,5,6].</p>
<p>I want to know how to do this when my list is not a list of numbers, but a list of matrices. I imagine it would be the same for a list of lists but I don't know how to do that either.</p>
https://ask.sagemath.org/question/32956/merge-lists-of-lists/?answer=32961#post-id-32961just use `+` as well. Python doesn't care what's in lists when it concatenates them.Sat, 02 Apr 2016 16:50:45 +0200https://ask.sagemath.org/question/32956/merge-lists-of-lists/?answer=32961#post-id-32961