Algorithm/Problem Solving [Python] 0