Advertisement
PadmaJS

Untitled

Oct 11th, 2020
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def distance(strand_a, strand_b):
  2. val1 = list(strand_a)
  3. val2 = list(strand_b)
  4. count = 0
  5. if len(val1) == len(val2):
  6. for i in range(len(val1)):
  7. if val1[i] != val2[i]:
  8. count = count + 1
  9. return count
  10. else:
  11. raise Exception("ValueError")
  12. print(val1)
  13. print(val2)
  14. print(count)
  15.  
  16. distance("ABCD","ABCD")
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement