Solutions for CodingBat.com in Python