转载自:http://blog.csdn.net/wzgbm/article/details/54691615 首先给一个简单的例子,测测list和dict查找的时间: ,-,-,-,-,,,,,,] lst = [] dic = {} ): lst.append(i) dic[i] = start = time.time() for v in query_lst: if v in lst: continue end1 = time.time() for v in query_lst: if v
函数之间传递list: def show(ll): for i in ll: print(i) show(['chen','hang','wang','yadan']) #========================================== chen hang wang yadan *args:输入数据长度不确定,通过*args将任意长度的参数传递给函数,系统自动将任意长度参数用list表示 def show(*args): for i in args: print(i) sho