add python code to solve.