Python problem 6-10