Python Reduce Initial Value Theorem Calculator