feat: add task 1 draft
This commit is contained in:
28
task1.py
Normal file
28
task1.py
Normal 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)
|
||||||
Reference in New Issue
Block a user