>>322
こうか?
reduce(lambda ls,x: ls[:-1]+[ls[-1]+x, x], a, [0])[1:-1]