Python不特定个数列表比较,返回参与比较列表元素的有无
作者:互联网
def listCompare(*args): res = [] listall = [] for i in range(len(args)): listall += args[i] listall = list(set(listall)) listall.sort() for item1 in listall: reslist = [] reslist.append(item1) for j in range(len(args)): if item1 in args[j]: reslist.append("有") else: reslist.append("無") res.append(reslist) return res
标签:item1,Python,res,args,列表,append,reslist,比较,listall 来源: https://www.cnblogs.com/yanweichen/p/15255332.html