Lost in Translation (CodeEval) in python2.