Adding problem 28 in Python