Problem solving and python programming