python hw2 fix task2, 3