mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Compare commits
2 Commits
44314e4e6d
...
8e56b7e2c5
Author | SHA1 | Date | |
---|---|---|---|
|
8e56b7e2c5 | ||
|
65b95a62b5 |
@ -9,7 +9,7 @@ MISMATCH = -1
|
||||
GAP = -2
|
||||
|
||||
|
||||
def score_function(a: str, b: str) -> int:
|
||||
def score_function(source_char: str, target_char: str) -> int:
|
||||
"""
|
||||
Calculate the score for a character pair based on whether they match or mismatch.
|
||||
Returns 1 if the characters match, -1 if they mismatch.
|
||||
@ -18,7 +18,7 @@ def score_function(a: str, b: str) -> int:
|
||||
>>> score_function('A', 'C')
|
||||
-1
|
||||
"""
|
||||
if a == b:
|
||||
if source_char == target_char:
|
||||
return MATCH
|
||||
else:
|
||||
return MISMATCH
|
||||
|
Loading…
x
Reference in New Issue
Block a user