📜  python代码示例中的p和c

📅  最后修改于: 2022-03-11 14:47:21.827000             🧑  作者: Mango

代码示例1
# permutation and combinataion in python
# let a list of dice having numbers 1 to 6
import itertools
lst = [1, 2, 3, 4, 5, 6]
# PERMUTATIONS of two numbers.
print(list(itertools.permutations(lst, 2)))
# COMBINATION of two numbers
print(list(itertools.combination(lst,2)))