Newtons Method Python Code For Snake