On 4/4/2010 7:46 PM, monkeys paw wrote:
Why does the following fail with the Traceback?
def add(x,y): return x+y
for rrr in range(1,20):
I presume that this was 'for r...'
reduce(add, range(1, r))
and that this was indented.
Traceback (most recent call last):
File "", line 2, in
TypeErr
On Sun, Apr 4, 2010 at 7:46 PM, monkeys paw wrote:
> Why does the following fail with the Traceback?
>
> def add(x,y): return x+y
> for rrr in range(1,20):
> reduce(add, range(1, r))
>
> Traceback (most recent call last):
> File "", line 2, in
> TypeError: reduce() of empty sequence with
Why does the following fail with the Traceback?
def add(x,y): return x+y
for rrr in range(1,20):
reduce(add, range(1, r))
Traceback (most recent call last):
File "", line 2, in
TypeError: reduce() of empty sequence with no initial value
--
http://mail.python.org/mailman/listinfo/pytho