Python Code For Gradient Descent Method