python基础知识整理自用

list=[x**2 for x in range(10)]
L=[1,2,3,4]
def f(x):
    return (x**2)
r=map(f,L)
def dd(x,y):
print (reduce (dd,L))
def is_odd(n):
    return n % 2 == 1

print(list(filter(is_odd, [1, 2, 4, 5, 6, 9, 10, 15])))

 


posted @ 2018-01-22 20:43  国际惯例  阅读(121)  评论(0编辑  收藏  举报