Trapezoidal Method Python Code For Snake