diff --git a/skorohodovsa/task_1/linked_list.py b/skorohodovsa/task_1/linked_list.py index d7caab6..b1fe2d3 100644 --- a/skorohodovsa/task_1/linked_list.py +++ b/skorohodovsa/task_1/linked_list.py @@ -12,7 +12,7 @@ def create_linked_list(data: list[dict]) -> dict: for value in data[1:]: current['next'] = create_node(**value) current = current['next'] - + return base @@ -20,8 +20,15 @@ def ll_insert(): pass -def ll_find(): - pass +def ll_find(head: dict, name: str) -> str | None: + if head is None: + raise ValueError("Словарь пустой!") + + current = head + while current['next'] is not None: + if current['name'] == name: + return current['name'] + return None def ll_delete():