Creating a list of lists and appending lists
<pre><code>a=[[2,3],[3,4]]
b=[[5,6],[7,8],[9,10]]
c=[[11,12],[13,14],[15,16],[17,18]]
c1=[[11,12],[13,14],[15,16],[17,18]]

listr=[]        
for number in range(96):
    listr.append(number)

list = [[]]*96
for e in a:
    for f in b:
        for g in c:
            for h in d:
                for i in listr:
                    list[i].append(e)
                    list[i].append(f)
                    list[i].append(g)
print list
</code></pre>

<p>I am having real difficulty with this simple problem. I would like to create a list of lists of every combination possible from the above lists. If the list repeats, as in [[2,3],[5,6],[11,12],[11,12]] would not be good, the first combination would be [[2,3],[5,6],[11,12],[13,14]]. This isnt a great start but I know it isnt hard but my programming skills arent strong.</p>

<p>The final list would look like</p>

<pre><code>[[[2,3],[5,6],[11,12],[13,14]],[[2,3],[5,6],[11,12],[15,16]],[[2,3],[5,6],[11,12],[17,18]],...,[[3,4],[9,10],[15,16],[17,18]]]
</code></pre>

<p>I would also like to add the 1st number of each list in each individual list and add them together.
[[31],[33],[35],...,[44]]</p>

<p>You may want to use <a href="https://docs.python.org/2/library/itertools.html#itertools.product" rel="nofollow"><code>itertools.product</code></a> to solve this.</p>

<p>Assuming you want combinations from <code>a</code>, <code>b</code>, <code>c</code> and <code>d</code> in groups of 4 (and based on your expected output I think you have a typo in your <code>c1</code> which I'm calling <code>d</code>, adapt as necessary):</p>

<pre><code>&gt;&gt;&gt; import itertools
&gt;&gt;&gt; a = [[2, 3], [3, 4]]  # are you sure this isn't actually [[1, 2], [3, 4]]?
&gt;&gt;&gt; b = [[5, 6], [7, 8], [9, 10]]
&gt;&gt;&gt; c = [[11, 12], [13, 14]]
&gt;&gt;&gt; d = [[15, 16], [17, 18]]
&gt;&gt;&gt;
&gt;&gt;&gt; list(itertools.product(a, b, c, d))
[([2, 3], [5, 6], [11, 12], [15, 16]),  # pretty printed for readability
 ([2, 3], [5, 6], [11, 12], [17, 18]),
 ([2, 3], [5, 6], [13, 14], [15, 16]),
 ([2, 3], [5, 6], [13, 14], [17, 18]),
 ...
 ([3, 4], [9, 10], [13, 14], [17, 18])]
&gt;&gt;&gt; len(list(itertools.product(a, b, c, d)))
24
</code></pre>

<p>And btw, when you're trying to create a list of int's, instead of:</p>

<pre><code>listr=[]        
for number in range(96):
    listr.append(number)
</code></pre>

<p>you only need to do:</p>

<pre><code>listr = range(96)        # in Python2
# or
listr = list(range(96))  # in Python3
</code></pre>

python list append