rename vars

This commit is contained in:
onyx-and-iris 2024-01-18 01:18:01 +00:00
parent 2ad10efb47
commit 73dc3210e5
3 changed files with 13 additions and 13 deletions

View File

@ -42,13 +42,13 @@ X = "fosh"
Y = "fort"
logger.info(f"words: {X} {Y}")
longest_subsequence = longest_common_subsequence(X, Y, len(X), len(Y))
print(f"Longest common subsequence: {longest_subsequence}")
length = longest_common_subsequence(X, Y, len(X), len(Y))
print(f"Longest common subsequence: {length}")
X = "fosh"
Y = "fish"
logger.info(f"words: {X} {Y}")
longest_subsequence = longest_common_subsequence(X, Y, len(X), len(Y))
print(f"Longest common subsequence: {longest_subsequence}")
length = longest_common_subsequence(X, Y, len(X), len(Y))
print(f"Longest common subsequence: {length}")

View File

@ -45,13 +45,13 @@ X = "fish"
Y = "vish"
logger.info(f"words: {X} {Y}")
longest_substring = longest_common_substring(X, Y, len(X), len(Y))
print(f"Longest common substring: {longest_substring}")
length = longest_common_substring(X, Y, len(X), len(Y))
print(f"Longest common substring: {length}")
X = "vista"
Y = "hish"
logger.info(f"words: {X} {Y}")
longest_substring = longest_common_substring(X, Y, len(X), len(Y))
print(f"Longest common substring: {longest_substring}")
length = longest_common_substring(X, Y, len(X), len(Y))
print(f"Longest common substring: {length}")

View File

@ -47,10 +47,10 @@ K = 4
k_nearest = knn(point, neighbours)
average_sold = 0
total = 0
for n in k_nearest:
average_sold += n.sold
average_sold = average_sold / K
total += n.sold
average = total / K
logger.debug(average_sold)
print(f"Number of loaves to make: {int(round(average_sold, 0))}")
logger.debug(average)
print(f"Number of loaves to make: {int(round(average, 0))}")