Lambda
![[python] filter](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcClwqV%2FbtqIZndwV6j%2FCHh2DfYqpFJHvmVUqAIAq1%2Fimg.png)
[python] filter
📗 filter python의 built-in함수로 리스트나 딕셔너리같은 iterable한 데이터를 조건에 맞는 값만 추출할 때 사용하는 함수이다. 🔵 사용법 filter(function(함수), iterable(리스트나 딕셔너리등) 🔹 함수를 넣어 사용할 때 def func(x): if x % 2 == 1: return x lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] odd_lst = list(filter(func, lst)) print(odd_lst) # >>> [1, 3, 5, 7, 9] 🔹 lambda로 사용할 때 lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] odd_lst = list(filter(lambda x: x % 2 == 1, lst)) pr..