feat: add task 1 draft

This commit is contained in:
2026-02-09 20:45:21 +06:00
parent b0b067e553
commit cd3ca3d014

28
task1.py Normal file
View File

@@ -0,0 +1,28 @@
from dataclasses import dataclass
from typing import Iterable
@dataclass
class Poem:
name: str
author: str | list[str]
body: str
def load_data() -> list[Poem]:
raise NotImplementedError
def search_by_author(poems: list[Poem], author: str) -> list[Poem]:
raise NotImplementedError
def get_sorted_poems(poems: list[Poem]) -> list[Poem]:
raise NotImplementedError
def print_poems(poems: Iterable[Poem]) -> None:
raise NotImplementedError
poems = load_data()
author: str = input()
poems = search_by_author(poems, author)
poems = get_sorted_poems(poems)
print_poems(poems)