problem 2 solved (python)