added python solution to 2nd problem