So I'm now learning about nested pools and I don't really get it. my task is to return all matching pairs in following format:
[('AAG', 'TTC'), ('GAT', 'CTA'), ('TTG', 'AAC'), ('CAT', 'GTA'), ('GGC', 'CCG'), ('ATT', 'TAA'), ('TCT', 'AGA')]
so this is my code:
def matching_codons(complements, poolA, poolB):
complements = {'A':'T', 'C':'G', 'T':'A', 'G':'C'}
poolA = ['AAG', 'TAC', 'CGG', 'GAT', 'TTG', 'GTG', 'CAT', 'GGC', 'ATT', 'TCT']
poolB = ['TAA', 'CTA', 'AAC', 'TTC', 'AGA', 'CCC', 'CCG', 'GTA']
final = []
for i in poolA:
for z in poolB:
if i and z in complements:
final.append()
return(final)
It's not working and I don't know why, I don't quite get it. How can I make a statement so that the poolA and the poolB will match according to the dictionary provided?