From 21985795a1660295b517b3209e229c562f81390a Mon Sep 17 00:00:00 2001 From: volkovva Date: Sat, 23 May 2026 13:23:41 +0300 Subject: [PATCH] =?UTF-8?q?[1]=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8E=20ll=5Finse?= =?UTF-8?q?rt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VolkovVA/cod.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/VolkovVA/cod.py b/VolkovVA/cod.py index e69de29..7495326 100644 --- a/VolkovVA/cod.py +++ b/VolkovVA/cod.py @@ -0,0 +1,20 @@ +import random as rnd + +def ll_insert(head, name, phone): + new_node = {'name': name, 'phone': phone, 'next': None} + + if head is None: + return new_node + + + current = head + while current is not None: + if current['name'] == name: + current['phone'] = phone + return head + current = current['next'] + + + new_node['next'] = head + return new_node +