with open("address_book.csv","r")as f:
next(f)
n=0
a=[]
for i in f:
p=i.split(",")
a.append(p)
b=input()
nn=0
for i in range (0,len(a)):
nn+=1
if b==a[i][0]:
print("{}的手机号码是:{}".format(b,a[i][1]))
print("{}的QQ号是:{}".format(b,a[i][2]))
print("{}的微信号是:{}".format(b,a[i][3]))
break
if nn==len(a):
print("{}信息不存在!".format(b))
CSV通信录文件信息查询
最新推荐文章于 2024-08-21 13:31:24 发布