Solve problems 12-13 using Python.