Compare commits

...

2 Commits

Author SHA1 Message Date
Belhadj Ahmed Walid
8e56b7e2c5 Merge branch 'master' of https://github.com/BAW2501/Python 2023-08-22 13:26:01 +01:00
Belhadj Ahmed Walid
65b95a62b5 descriptive names for the parameters a and b 2023-08-22 13:25:36 +01:00

View File

@ -9,7 +9,7 @@ MISMATCH = -1
GAP = -2 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. Calculate the score for a character pair based on whether they match or mismatch.
Returns 1 if the characters match, -1 if they 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') >>> score_function('A', 'C')
-1 -1
""" """
if a == b: if source_char == target_char:
return MATCH return MATCH
else: else:
return MISMATCH return MISMATCH