Trapezoidal Integration Code In Python