일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- sql
- join
- counter
- time complexity
- python
- Level2
- collections
- mysql
- 프로그래머스
- 완전탐색
- Queue
- 연습문제
- 조합
- coding
- programmers
- 코딩테스트
- 코딩
- CodingTest
- level4
- 데이터분석
- 시간복잡도
- coding test
- import re
- BFS
- lambda
- itertools
- 코테
- 파이썬
- Stack
- lv4
- Today
- Total
목록cycle (1)
ror_coding
[Python] Permutations, Combination, Product (Itertools)
from itertools importpermutations (순열)combinations (조합)product (주어진 반복 가능한 객체(iterable)들로 만들 수 있는 모든 조합 반환)cycle from itertools import permutations as perm # 순열from itertools import combinations as comb # 조합from itertools import product # 모든 가능한 조합from itertools import cycle for p in perm(data): # 순열. (모든 경우의 수)for c in comb(data, 3): # 3개씩 조합.# productl = [(x, -x) for x in numbers] # [(4, -4), ..
Algorithm/Python
2024. 12. 4. 14:59