How to create tuples from a single list with alpha-numeric chacters?
<p>I have the following list with 2 elements:</p>

<pre><code>['AGCTT 6 6 35 25 10', 'AGGGT 7 7 28 29 2']
</code></pre>

<p>I need to make a list or zip file such that each alphabet corresponds to its number further in the list. For example in list[0] the list/zip should read</p>

<pre><code>{"A":"6", "G":"6", "C":"35","T":"25","T":"10"}
</code></pre>

<p>Can I make a list of such lists/zips that stores the corresponding vales for list[0], list[1],...list[n]?</p>

<p>Note: The alphabets can only be A,G,C or T, and the numbers can take anyvalue</p>

<p>Edit 1: Previously, I thought I could use a dictionary. But several members pointed out that this cannot be done. So I just want to make a list or zip or anything else recommended to pair the Alphabet element to its corresponding number. </p>

<p>This code would work, assuming the elements in the list are correctly formed.
This means the number of letters and numbers must match!</p>

<p>And it will overwrite the value if the key already exists.</p>

<pre><code>list = ['AGCTT 6 6 35 25 10', 'AGGGT 7 7 28 29 2']
dictionary = {}

for line in list:
    split_line = line.split()
    letters = split_line[0]
    iterator = 1
    for letter in letters:
        dictionary[letter] = split_line[iterator]
        iterator += 1

print dictionary
</code></pre>

<p>This modified one will check if the key exists and add it to a list with that key:</p>

<pre><code>list = ['AGCTT 6 6 35 25 10', 'AGGGT 7 7 28 29 2']
dictionary = {}

for line in list:
    split_line = line.split()
    letters = split_line[0]
    iterator = 1
    for letter in letters:
        if letter in dictionary.keys():
            dictionary[letter].append(split_line[iterator])
        else:
            dictionary[letter] = [split_line[iterator]]

        iterator += 1

print dictionary
</code></pre>

python list dictionary zip tuples