[1] initial commit
This commit is contained in:
parent
4e29dfb4bb
commit
2163ccd0aa
|
|
@ -5,7 +5,6 @@ import csv
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
def insert(lisst,name,phone):
|
def insert(lisst,name,phone):
|
||||||
#global lisst
|
|
||||||
if len(lisst)==0:
|
if len(lisst)==0:
|
||||||
entry={"name":name,"phone":phone,"next":None}
|
entry={"name":name,"phone":phone,"next":None}
|
||||||
lisst.append(entry)
|
lisst.append(entry)
|
||||||
|
|
@ -32,13 +31,11 @@ def insert(lisst,name,phone):
|
||||||
return lisst
|
return lisst
|
||||||
|
|
||||||
def find(lisst, name):
|
def find(lisst, name):
|
||||||
#global lisst
|
|
||||||
if len(lisst)>0:
|
if len(lisst)>0:
|
||||||
if lisst[0]["name"]==name:
|
if lisst[0]["name"]==name:
|
||||||
return lisst[0]["phone"]
|
return lisst[0]["phone"]
|
||||||
elif lisst[0]["next"]!=None:
|
elif lisst[0]["next"]!=None:
|
||||||
nexxt=lisst[0]["next"]
|
nexxt=lisst[0]["next"]
|
||||||
#print(nexxt)
|
|
||||||
while nexxt["next"]!=None:
|
while nexxt["next"]!=None:
|
||||||
if nexxt["name"]==name:
|
if nexxt["name"]==name:
|
||||||
return nexxt["phone"]
|
return nexxt["phone"]
|
||||||
|
|
@ -50,7 +47,6 @@ def find(lisst, name):
|
||||||
|
|
||||||
|
|
||||||
def delete(lisst,name):
|
def delete(lisst,name):
|
||||||
#global lisst
|
|
||||||
if len(lisst)>0:
|
if len(lisst)>0:
|
||||||
if lisst[0]["name"]==name:
|
if lisst[0]["name"]==name:
|
||||||
if lisst[0]["next"]!=None:
|
if lisst[0]["next"]!=None:
|
||||||
|
|
@ -128,7 +124,6 @@ def Shell(names,phones):
|
||||||
return names,phones
|
return names,phones
|
||||||
|
|
||||||
def list_all(lisst):
|
def list_all(lisst):
|
||||||
#global lisst
|
|
||||||
names=[]
|
names=[]
|
||||||
phones=[]
|
phones=[]
|
||||||
if len(lisst)>0:
|
if len(lisst)>0:
|
||||||
|
Can't render this file because it has a wrong number of fields in line 9.
|
Loading…
Reference in New Issue
Block a user