"Python reduce()"의 두 판 사이의 차이

(새 문서: ==개요== ;Python reduce() <source lang='python'> from functools import reduce a = [2, 3, 4, 5] print( reduce((lambda x, y: x*y), a) ) # 120 </source> ==같이 보기== * Python...)
 
 
(사용자 2명의 중간 판 2개는 보이지 않습니다)
2번째 줄: 2번째 줄:
;Python reduce()
;Python reduce()


<source lang='python'>
<syntaxhighlight lang='python' run>
from functools import reduce
from functools import reduce
a = [2, 3, 4, 5]
a = [2, 3, 4, 5]
print( reduce((lambda x, y: x*y), a) )
print( reduce((lambda x, y: x*y), a) ) # 120
# 120
</syntaxhighlight>
</source>


==같이 보기==
==같이 보기==

2021년 5월 3일 (월) 01:46 기준 최신판

1 개요[ | ]

Python reduce()
from functools import reduce
a = [2, 3, 4, 5]
print( reduce((lambda x, y: x*y), a) ) # 120

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}