Add Python solution to the 2nd question