[Python] ์์ด, ์กฐํฉ
๐ ์กฐํฉ from itertools import combinations # ์กฐํฉ(์์x)nums=[1,2,3,4]arr = list(combinations(nums, 3)) #์ถ๋ ฅ: [(1, 2, 3), (1, 2, 4), (1, 3, 4), (2, 3, 4)] ๐ ์์ด from itertools import permutations # ์์ด(์์ o)nums=[1,2,3,4]arr = list(permutations(nums, 3)) #์ถ๋ ฅ: [(1, 2, 3), (1, 2, 4), (1, 3, 2), (1, 3, 4), (1, 4, 2), (1, 4, 3), # (2, 1, 3), (2, 1, 4), (2, 3, 1), (2, 3, 4), (2, 4, 1), (2, 4, 3), # ..