Solver Iteration In Python