54.python filter map lambda list配合使用
f __name__ == '__main__': print('test211') alist = [1,2,3,4,5,6,7,8,9] blist = list(filter((lambda x:x%2==0),alist)) print(blist) clist = list(map((lambda x:x*2),alist)) print(clist) import sys sys.exit()
欢迎讨论,相互学习。
cdtxw@foxmail.com