Adding python program for question 2