python, logic-2