from itertools import permutations

def longestWord(letters):
    return [''.join(i) for i in permutations(letters)]
print(longestWord('aah'))
Converting the output of itertools.permutations from list of tuples to list of strings