From 16fd3a925a7f282bc6d56e55af3ea7332aeb476f Mon Sep 17 00:00:00 2001 From: Andrey Golikov Date: Wed, 18 Feb 2026 21:38:46 +0600 Subject: [PATCH] style: code cleanup --- task5/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/task5/main.py b/task5/main.py index a39a448..05bc09d 100644 --- a/task5/main.py +++ b/task5/main.py @@ -18,7 +18,7 @@ mice: list[int] = [i for i in range(grey + white)] eaten: list[int] = [] current_mouse = 0 while len(mice) > total_remaining: - current_mouse: int = (current_mouse + S) % len(mice) + current_mouse = (current_mouse + S) % len(mice) eaten.append(mice[current_mouse]) mice.pop(current_mouse) @@ -36,6 +36,6 @@ for i in range(white - white_remaining): pattern[eaten.pop(0)] = Mouse.white if len([a for a in pattern if a == Mouse.grey]) != grey or pattern[0] != Mouse.grey: - raise ValueError(f"Невозможный исход: {" ".join(map(lambda x: str(x.value), pattern))}") + raise ValueError(f"Невозможный исход: {" ".join(str(mouse.value) for mouse in pattern)}") -print(*map(lambda x: x.value, pattern)) +print(*(str(mouse.value) for mouse in pattern))