일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- 완전탐색
- lambda
- lv4
- tableau
- 파이썬
- coding test
- python
- collections
- 코딩테스트
- sql
- mysql
- 코테
- programmers
- level4
- time complexity
- coding
- cte
- 조합
- AARRR
- Growth hacking
- import re
- Stack
- itertools
- LeetCode
- 프로그래머스
- counter
- 코딩
- Level2
- join
- Queue
Archives
- Today
- Total
목록from functools (1)
ror_coding
[Python] reduce (functools)
from functools import reduce (누적 함수 적용)partial (함수의 일부 인수 고정해서 새로운 함수 생성)lru_cache (함수의 실행 결과 캐싱하여 동일한 입력에 대해 빠르게 반환) reducefrom functools import reducefrom math import gcd# 리스트의 모든 값 곱하기nums = [1, 2, 3, 4]= reduce(lambda x, y: x * y, nums) # 24= reduce(gcd, nums) # 모든 원소의 최대공약수 구함. partialfrom functools import partial# 기본 인자를 고정한 함수 생성def power(base, exp): return base ** expsquare = partial(..
Coding Test/Python
2025. 1. 16. 16:33