Skip to content

Commit c50e703

Browse files
committed
scoring_algorithm: uses enumeration instead of manual indexing on loop var
1 parent 825e4e9 commit c50e703

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

other/scoring_algorithm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ def procentual_proximity(source_data: list[list[float]], weights: list[int]) ->
3838
# getting data
3939
data_lists: list[list[float]] = []
4040
for data in source_data:
41-
for i in range(len(data)):
41+
for i, el in enumerate(data):
4242
try:
43-
data_lists[i].append(float(data[i]))
43+
data_lists[i].append(float(el))
4444
except IndexError:
4545
# generate corresponding number of lists
4646
data_lists.append([])
47-
data_lists[i].append(float(data[i]))
47+
data_lists[i].append(float(el))
4848

4949
score_lists: list[list[float]] = []
5050
# calculating each score

0 commit comments

Comments
 (0)