일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 코딩테스트
- 프로그래머스
- Queue
- import re
- programmers
- itertools
- 조합
- tableau
- AARRR
- hackerrank
- 코딩
- mysql
- time complexity
- LeetCode
- Level2
- coding test
- 코테
- join
- Growth hacking
- cte
- python
- Stack
- sql
- lv4
- level4
- 완전탐색
- coding
- counter
- lambda
- 파이썬
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