关于map()与filter()

def f1(a):
    if a == 3:
        pass
    else:
        return a*a
li = [1,2,3,4]
for i in filret(f1,li)
  print(i)
def f1(a):
    if a == 3:
        pass
    else:
        return a*a
li = [1,2,3,4]
# for i in filter(f1,li):
#     print(i)

for i in map(f1,li):
    print(i)

posted @ 2017-01-14 13:17  TianTianLi  阅读(143)  评论(0编辑  收藏  举报