problem 4 + 5 (python)