2D List Mystery
Can someone please walk me through how to get these outputs for this 2D List Mystery code? I'm having trouble following it... def mystery(data, pos, n): result = set() for i in range(0, n): for j in range(0, n): result.add(data[i + pos][j + pos]) return result Suppose that a variable called grid has been declared as follows: grid = [[8, 2, 7, 8, 2, 1], [1, 5, 1, 7, 4, 7], [5, 9, 6, 7, 3, 2], [7, 8, 7, 7, 7, 9], [4, 2, 6, 9, 2, 3], [2, 2, 8, 1, 1, 3]] which means it will store the following 6-by-6 grid of values: 827821 151747 596732 787779 426923 228113 For each call below, indicate what value is returned. If the function call results in an error, write "error" instead. Function Call mystery(grid, 2, 2) mystery(grid, 0, 2) mystery(grid, 3, 3) Contents of Set Returned: {6, 7} {1, 2, 5, 8} {1, 2, 3, 7, 9}