Added Problem 29

Python solution to problem 29
Added Problem 40

Python solution to Problem 40