Hackerrank Tuples Python Solution Puzzle