73. 파이썬 functools.reduce 표준 라이브러리
지난 시간에는 파이썬 표준 라이브러리 itertools.permutations 와 itertools.combinations 에 대해 알아보았습니다.이번 포스팅에서는 파이썬 표준 라이브러리 중 functools.reduce 에 대해 공부해 보도록 하겠습니다. 파이썬 표준 라이브러리 functools.reduce functools.reduce 함수는 functools.reduce(function, iterable) 의 형태로 사용하며 function 을 반복 가능한 객체인 iterable 의 요소에 차례 차례 좌에서 우로 누적해서 적용하며 이 객체를 하나의 값으로 줄여주는 함수 입니다. 아래 … Read more