1
2
3
4
5
6
7
8
9
10
11
12
13
|
import itertools
abc = [1,2,3,4]
#abc = ['a','b','c','d']
b = itertools.permutations(abc, 3) #target, length(Non-Essential)
for i in b:
#i = list(i)
print(list(i))
b = itertools.combinations(abc, 2) #target, length(Essential)
for i in b:
#i = list(i)
print(list(i))
|
'Programming Language > Python' 카테고리의 다른 글
파이썬 10진수 n진수로 변환 (0) | 2019.10.12 |
---|---|
Python 순열(Permutation) (0) | 2019.10.09 |
Python String copy (0) | 2019.10.09 |
Python Dictionary Max, Min Key, Value(파이썬 딕셔너리, 사전 최대 최소 구하기) (0) | 2019.10.05 |
문자열 입력 Python (0) | 2019.09.28 |