itertools.permutations()

Sort by

recency

|

946 Discussions

|

  • + 0 comments
    from itertools import permutations
    s = list(input().split(" "))
     
    a = list((permutations(s[0],int(s[1]))))
    a.sort()
    print(*map(''.join,a),sep='\n')
    
  • + 1 comment

    I have solved this problem yet it is not getting marked as solved. Has it happened to anyone of you? What to do in such a case?

  • + 0 comments

    ****from itertools import permutations Q,J=input().split() d=sorted(permutations(Q,int(J)))

    ***for w in d: print("".join(w))*

  • + 0 comments
    from itertools import permutations
    s,k=input().split()
    for i in permutations(sorted(s),int(k)):
        print(''.join(i))
    
  • + 0 comments
    from itertools import permutations
    string,size=input().split()
    string=sorted(string)
    size=int(size)
    for i in list(permutations(string,size)):
        print(''.join(i))