itertools.permutations()

Sort by

recency

|

948 Discussions

|

  • + 0 comments

    from itertools import permutations

    a , b = input().split() b = int(b) permutations_groups = permutations(sorted(a),b)

    for j in permutations_groups: print(*j,sep="")

  • + 0 comments
    from itertools import permutations
    if __name__ == '__main__':
        s = input().split()
        ans = sorted(list(permutations(s[0],int(s[-1]))))
        for item in ans:
            print("".join(item))
    
  • + 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))*