❮ reduce
❯
reduce empty list
examples/functional/reduce_empty.py
from functools import reduce numbers = [] print(reduce(lambda x,y: x+y, numbers)) # TypeError: reduce() of empty sequence with no initial value
from functools import reduce numbers = [] print(reduce(lambda x,y: x+y, numbers)) # TypeError: reduce() of empty sequence with no initial value