def reducelist(f, lst, x=0):
    prev = x
    for i in lst:
        prev = f(prev, i)
        (yield prev)
def reducelist(f, lst, x=0):
    prev = x
    for i in lst:
        prev = f(prev, i)
        (yield prev)