Python | Permutation of a given string using a built-in function