problem 1 in python