Adds Problem 46 in Python