I have a list I3. I am performing an index operation through I4 and appending based on the length of I3. The current and expected outputs are presented.
I3 = [[(0, 0), (0, 1)], [(0, 0), (1, 0)], [(0, 1), (1, 1)], [(1, 0), (1, 1)]] for t in range(0,len(I3)): I4 = [(j, -i) for i, j in I3[t]] I4.append(I4) print("I4 =",I4) The current output is:
I4 = [(0, 0), (1, 0), [...]] I4 = [(0, 0), (0, -1), [...]] I4 = [(1, 0), (1, -1), [...]] I4 = [(0, -1), (1, -1), [...]] The expected output is:
I4 = [[(0, 0), (1, 0)],[(0, 0), (0, -1)],[(1, 0), (1, -1)],[(0, -1), (1, -1)]]