Ref
http://mp.weixin.qq.com/s?__biz=MjM5NzU0MzU0Nw==&mid=211637608&idx=1&sn= 1aa3d81c2c56fc87533c49f912692742&scene=0&key= Dffc561732c22651a58840064393fadfff612048d19d8fde33d3062e3072d56b15a4c6f3346a0b8fcd142ef0607dbf92&ascene=1 &uin=mji2mtm3mduwma%3d%3d&devicetype=webwx&version=70000001&pass_ticket=z7bdkmf60pputy3aii% 2bxlj2hbvaiwlxhzjoa22y5qv8ugvvf%2bichyrbpeyxp3ksq
The first one is covered, and reduce how to come out so many parameters, especially the last one does not understand
Then tried it:
>>> reduce (Lambda x,y:x+y,range (101), 1)5051
1 should be a starting value, but the next action is to assign the value of 0 to Y to continue, or to assign the value to X to continue, unclear
Apply a function of arguments cumulatively to the items of a sequence, from Left -to-right, as-to-reduce the sequence to a single value. For example, reduce (lambda x, Y:x+y, [1, 2, 3, 4, 5]) calculates (((((1+2) +3) +4) +5). IS are placed before the items in the calculation and serves as a default when the is empty.
So far, we've seen enumerate with a starting value.
T=range (Ten) for in enumerate (t,start=1): print index,value 1 02 13 24 35 46 57 68 79 810 9
and sum
>>> sum (Range (0,101), 1)5051
Built-in function start value