Answers for "p and c in python"

0

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)))
Posted by: Guest on October-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language