itertools.permutations()

  • + 0 comments

    from itertools import permutations string, k= input().split() [print(*i , sep="") for i in list(permutations(sorted(string),int(k)))]