A common operation I perform is joining a list of lists of letters into a list of words (strings).
I normally use a list comprehension:
lists_of_letters = [["m", "y"], ["d", "o", "g"], ["s", "k", "i", "p"]]
list_of_words = ["".join(a_list_of_letters) for a_list_of_letters in lists_of_letters]
# list_of_words == ["my", "dog", "skip"]
Or sometimes a little more functional:
list_of_words = map(lambda x: "".join(x), lists_of_letters)
I'm wondering if there is a better way to write the function needed for the map call than using a lambda expression. I'm trying to learn the operator and functools to expand my python functional programming chops, but I can't seem to find a clear way to use them in this case.