Soled Problem 25, Python