bioinformatics-course/Code/PatternCount.py
2019-10-29 01:22:16 +01:00

7 lines
184 B
Python

def PatternCount(Text, Pattern):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern:
count = count+1
return count