Say I have list with elements content = ['121\n', '12\n', '2\n', '322\n']
and list with functions fnl = [str.strip, int]
.
So I need to apply each function from fnl
to each element from content
sequentially.
I can do this by several calls map
.
Another way:
xl = lambda func, content: map(func, content)
for func in fnl:
content = xl(func, content)
I'm just wondering if there is a more pythonic way to do it.
Without separate function? By single expression?