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 "<interactive input>", line 2, in <module>
TypeError: reduce() of empty sequence with no initial value
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to