core python programming excercise