Since the code under the if condition is the same under the else statement, I believe you can change this:
def ApproximatePatternCount(Pattern, Text, d):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern:
count += 1
elif HammingDistance(Text[i:i+len(Pattern)], Pattern) <= d:
count += 1
return count
for this:
def ApproximatePatternCount(Pattern, Text, d):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern or HammingDistance(Text[i:i+len(Pattern)], Pattern) <= d:
count += 1
return count
In [ApproximatePatternCount.py](https://coolneng.duckdns.org/gitea/coolneng/biology-meets-programming/src/branch/master/Code/ApproximatePatternCount.py)
Since the code under the if condition is the same under the else statement, I believe you can change this:
def ApproximatePatternCount(Pattern, Text, d):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern:
count += 1
elif HammingDistance(Text[i:i+len(Pattern)], Pattern) <= d:
count += 1
return count
for this:
def ApproximatePatternCount(Pattern, Text, d):
count = 0
for i in range(len(Text)-len(Pattern)+1):
if Text[i:i+len(Pattern)] == Pattern or HammingDistance(Text[i:i+len(Pattern)], Pattern) <= d:
count += 1
return count
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In ApproximatePatternCount.py
Since the code under the if condition is the same under the else statement, I believe you can change this:
for this:
Good catch, will update it right now