Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Permutation in python



from itertools import permutations
from itertools import combinations
p = permutations([1,2,4]) # or  permutations([1, 2, 3], 2)
for i in p:
    print(i)
c = combinations([1,2,3],2)
for j in c:
    print(j)
    
    
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Permutation #python
ADD COMMENT
Topic
Name
1+1 =