
Dec. 6, 2012
4:15 p.m.
Currently: sum(iterable[, start]) Sums start and the items of an iterable from left to right and returns the total. start defaults to 0. The iterable‘s items are normally numbers, and the start value is not allowed to be a string I just learned that sum([[1,2],[3,4]],[]) produces: [1, 2, 3, 4] I would never have guessed that from the explanation above! I think the terms "sum" and "total" are misleading. apply(operator.add, [[1,2], [3,4]]) generates the same result, but emphasizes the use of +. I suggest either explaining this explicitly or providing an example. -- Bob Gailer 919-636-4239 Chapel Hill NC
4486
Age (days ago)
4486
Last active (days ago)
0 comments
1 participants
participants (1)
-
bob gailer