permutation in python

36

from itertools import permutations
a=permutations([1,2,3,4],2) 
for i in a: 
   print(i)
from itertools import permutations 
string="SOFT"
a=permutations(string) 
for i in list(a): 
   # join all the letters of the list to make a string 
   print("".join(i))
import itertools
list(itertools.permutations([1, 2, 3]))

Comments

Submit
0 Comments