def count_mismatches(seq1, seq2, max_mm):
 mm = 0
 for i in range(min(len(seq2), len(seq1))):
  if (seq1[i] != seq2[i]):
   mm += 1
   if (mm > max_mm):
    return mm
 return mm

def count_mismatches ( seq1 , seq2 , max_mm ) : mm = 0 for i in range ( min ( len ( seq2 ) , len ( seq1 ) ) ) : if ( seq1 [ i ] != seq2 [ i ] ) : mm += 1 if ( mm > max_mm ) : return mm return mm
counts mismatches .