-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path8.py
17 lines (14 loc) · 2.25 KB
/
8.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def HammingDistance(a, b):
a = a.lower()
b = b.lower()
hd = 0
for i in range(len(a)):
if a[i] != b[i]:
hd += 1
return(hd)
A = 'GGGCCGTTGGT'
B = 'GGACCGTTGAC'
# A = 'AGGCAAACCTCCTCCTACCGTAAAATCTGTTCAATAATAACGGGACTGGCGACGGCGTTTGGGATAATACCAGTCCATACTCAGTCGTTGTTAGCTCGAATAACTAGCGGTAGCTTACAATTGTGCTAATCGCAACCCGGTAGTCATGTCCCGATACGGGATTATCCAATGATCAGAAACGGAGATTTCGATCTTCCAATACCTCAGGGAGCCGCCCGGGGTGTGATCTCCCTAATTTCAGACGCGTAGAATCCCGAGGTTGCGGATCGCCGCAGTGGAAAACCCTCCTGCACTGTTCGGCGCTGCTGGATTATTAGCTTCGTACATGTGCTTATTTAACCTCACATTATGGATGCTATTTATCAGGGCGGCCAGTTTGCTATCGCGCCCGCTTGTGCGGGAATTTAATAGGTGAAGTTTCGTTGAGCCCTGCTGTACACAAGTCAGGTAAACACGCGAGTGCGTTGCTGGAACTCACTACGAACACGAGAAGTCGTCTACACACTCATTGAACCATGCTCAAAACTGCAATAACAGCTAGGGGTACTCTTATGGCGTGAGGAAAACTGCCAAGAGGCTAATGCCAACTCTATCAACATCTTTTCCCGGACTTGATGGATACCAGGTCGTGACTTTTTGTTCCAGGCTTTGACACTGTGGAGAATAAACCAAATTCACGGTTTCTGTACGTGAAGAACCATGGGGTGAGTATCGAAACCGAGGAAAAGCGTGGGCCCTAGGTACTCGTATCATCTTTCTTCCAAAATTGCTTTCTGTATACTACCCTTTTTCAACCGCGAAGACAAGAATGGAATGTAACAGACCAGAACCCTGTGAACTTGAGGTGACTTGCTTAATAGTAAGGGAATAGCCATTGACGGCTTCCCTGCTTTTCTGTCTATGATATGTATTTCTCTGCAGTAGCACCTCAGTAGCCAGCGCTTGAGATAGGAATAACACCGTCCAAACTAGCTTCTGTATCCGTGTGGCCTTGTGAGAACCAGACAGTCAATATGCATGGGCA'
# B = 'AAGAGGGAGCCATTAACCTTATGTCCGGCATCGCTTTTTCAAGAGGTAGCAGCGCAGGCATGGTTCCGTCGGTTACTTCGCGCACTCGAACGGCGCGCGGTACCCTGTAGCGATATCTAAACTACCGCCGAACATACCTGACACATGCCACACGCACGGCTACTCCCCCTTAGTGGGACTGTAAGCCCACCCGATCACAAATCGCCATAGTACTGTAGATGCAAACGGTTAGGTGGCATTATCAGAAAGATCCGCGAGCGATTGGAAGCACTGCAGACTAAGGAGTTCGCGAGCGTGGACTCAAGGTCGCTCTATTCCAGCGGTTTGTGTGAGTTGGCAATATACCCTCTATCTTAGCCGAGCTCGATTTATAAGCCGTCCGAAGCGTAGTACCTCGTATTCCGAACGAAAGGAAGGGTTATTCTTCCGATTTTATATTGAGACTTGATTGGGTGCCTGAGAGTAGATGGTGCCCGTCCGTTGCAGTCAGCACATTACCGAACTGAATCATCCGCGTTCGTTATTATTAACCGGGCCTTGATGATAGCTCAAGCCATGAAACCACCGGCCTGGAATTCCCGGCCTTACTTTCTGGGAGAACAATATTTAGTACCTAATGTTTAGCCGCCTTAGATAGGGTACAGATTAACGAAAACATGGGTTGAGCGACACTAGTTGCAACCGAACAGCCCCAATTGCCCTGCACAGAATATCCGAAGTGCCCTAAAGGCTCGCATATGCCTGTCGATTCTCTCACCTGGGTGGGGGTCGCCATTTTTTTCACTACTAGGCGCCGGTGATTACAGACGTAGATGATGCGTAGCGACCATGGAGCAATCTTCTTTAAAGATATTTTTTTTACAAGCACCCACCGGCCAGCCAGACTTCGCAACGCGCCGATTCGGAGGGTACTGGCTTATCGAGTCGGTGCCCGCCTCAAGGGGCGCTAGCGAACCGTGTGCGGCAAACAAATAAGTCCTTGTAGTGAGGAACTCAGCCCTAGTGATAAGTCTGCTGTTTACCG'
x = HammingDistance(A, B)
print(x)