Problem 31, Python
Problem 76, Python