I have a dictionary
selection60 = {"A":2, "T":2, "G":3, "C":3}
sseq60=[]
for k in selection60:
sseq60 = sseq60 + [k] * int(selection60[k])
random.shuffle(sseq60)
Output from this code:
sseq60=['C', 'G', 'T', 'C', 'C', 'A', 'G', 'G', 'T', 'A']
I know how to access the values for each key with the for loop. Now, I have a list of dictionaries:
[{'A': 2, 'T': 2, 'G': 3, 'C': 3}, {'A': 3, 'T': 3, 'G': 3, 'C': 1}]
How, to iterate over each dictionary in the list and do the same? Ultimately, I would like To do the same and create a list of list
Expected output:
[['C', 'G', 'T', 'C', 'C', 'A', 'G', 'G', 'T', 'A']['C', 'G', 'T', 'T', 'T', 'A', 'G', 'G', 'A', 'A']]