0

In pset6 DNA I'm using re.findall to find the nucleotides sequences but I'm only hardcoding the keys like this:

re.findall(r'(?:TATC)+', sequence)

So it's not working in the "large" database 'cause the nucleotides changes. Is there some re.findall() sintaxe that alows me to use a list as key and iterate over it? I tried to find online but I got nothing.

1 Answer 1

1

Make it an "fr" string and use a replacement field (string interpolation) as with

re.findall(rf'(?:{findme})+', sequence)

Where findme is set to the nucleotide to match.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .