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])))

原文地址:https://www.cnblogs.com/ysmdbk/p/8331049.html