jeudi 7 janvier 2016

Finding multiple patterns using findall funtion in Python

Is there any other way of finding multiple patterns using findall instead of just adding functions together? Im just starting with python...

txt = "UUUUUUUUUUUUUUCUUCUUCUUCUUCUUC"

print ("Phenylalanine " ) + str(len(re.findall(r'UUC',txt)) + len(re.findall(r'UUU',txt)))

I have 64 patterns to match with 23 names, how to do it with a table? Thank you

Aucun commentaire:

Enregistrer un commentaire