Python Reduce Initial Value And Boundary