Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

p and c in python

# 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)))
 
PREVIOUS NEXT
Tagged: #python
ADD COMMENT
Topic
Name
6+5 =