Created
October 14, 2016 17:15
-
-
Save robinsonkwame/b618bd1ba69463e9bdf9456653565811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import chain, repeat | |
from six.moves import reduce | |
def reducer(accum_value, x): | |
return tuple(sum(t) for t in zip(accum_value, x + (1,))) | |
k = (item for item in ((3,4),(4,66),(100,4))) | |
start = next(k)+(1,) | |
t = reduce(reducer, k, start) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment