Functional programming in python for e05