[파이썬] lambda 함수

lambda 함수

정의

https://dojang.io/pluginfile.php/13854/mod_page/content/3/032001.png

from functools import reduce
x = [1,2,3,4,5,6]
y = [1,2,3,4,5,6]
z = [1,5,6,3]
display(list(filter(lambda x: x % 2 == 0,x)))
display(list(map(lambda x,y: x+y, x,y)))
display(reduce(lambda x,y: x+y, z))