Discuss / Python / 作业

作业

Topic source

趁早_ing

#1 Created at ... [Delete] [Delete and Lock User]

def is_odd(n):

return n % 2 == 1

L = list(filter(is_odd, range(1, 20)))

print(L)

#匿名函数改装

r = list(filter(lambda n:n % 2 == 1,range(1,20)))

print(r)


  • 1

Reply