How to make a list of lists in Python?
<p>Assume,</p>

<pre><code>range(len(column)) = 4
column = ['AAA', 'CTC', 'GTC', 'TTC']
for i in range(len(column)):
    a = list(column[i])
</code></pre>

<p>Outside of this loop I want a variable,say x to be assigned such that it gives the following output. </p>

<pre><code> ['A', 'A', 'A']
 ['C', 'T', 'C']
 ['G', 'T', 'C']
 ['T', 'T', 'C']
</code></pre>

<hr>

<p>After doing this, here is what I should be able to do:
In the Next, I want to compare within x. Say x[2] to tell me if 'G' is different from 'T' and if 'G' is different from 'C' and if 'T' is different from 'C'</p>

<pre><code>inputs = ['ABC','DEF','GHI'] # list of inputs
outputs = [] # creates an empty list to be populated
for i in range(len(inputs)): # steps through each item in the list
    outputs.append([]) # adds a list into the output list, this is done for each item in the input list
    for j in range(len(inputs[i])): # steps through each character in the strings in the input list
        outputs[i].append(inputs[i][j]) # adds the character to the [i] position in the output list

outputs
[['A', 'B', 'C'], ['D', 'E', 'F'], ['G', 'H', 'I']]
</code></pre>

<p>edit
added comments as to what each line is doing</p>

python python-2.7 for-loop return