feature/vysledky: list z to_sorted_tuple() se vrací s číslováním pořadí
This commit is contained in:
@@ -208,8 +208,8 @@ def to_sorted_tuple(d: dict[str, int], s: bool = True) -> tuple[list[tuple[str,
|
||||
if s:
|
||||
d = dict(sorted(d.items(), key=lambda x: x[1], reverse=True))
|
||||
|
||||
for k in d:
|
||||
L.append((k, d[k]))
|
||||
for i, (k, v) in enumerate(d.items()):
|
||||
L.append((i+1, k, v))
|
||||
|
||||
return L, d
|
||||
|
||||
@@ -228,7 +228,7 @@ def check_win() -> str:
|
||||
|
||||
for c in count:
|
||||
if count[c] == 1:
|
||||
winner = L[0][0]
|
||||
winner = L[0][1]
|
||||
break
|
||||
|
||||
return winner
|
||||
|
||||
Reference in New Issue
Block a user