Files
bioinformatics-course/Code/PatternMatching.py
2019-10-21 18:01:27 +02:00

7 lines
206 B
Python

def PatternMatching(Pattern, Genome):
positions = []
for i in range(len(Genome)-len(Pattern)+1):
if Genome[i:i+len(Pattern)] == Pattern:
positions.append(i)
return positions