Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def chained(functions):
- accumulator = None
- def call_functions(unaryinput):
- if len(functions) == 0:
- return None
- accumulator = functions[0](unaryinput)
- for function in functions[1:]:
- accumulator = function(accumulator)
- return accumulator
- return call_functions
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement