I have been reading a lot of similar posts here, here, here, and so on, yet I cannot solve my problem. I have a list of list of pairs like this:
my_list = [[[0, 3], [0, 0]], [[77, 94], [76, 94], [77, 93], [76, 93], [76, 90], [77, 84], [76, 88]], [[25, 31], [10, 0]]]
And I want to multiply each integer by -1. I have tried different things and get different errors, but this is the most logical code I have written in my opinion:
for p in range(len(my_list):
for q in range(len(mylist[p])):
my_new_list = [[i,j] * -1 for [i,j] in my_list[p][q]]
And this one is not even working! What I eventually want is something like this:
my_new_list = [[[0, -3], [0, 0]], [[-77, -94], [-76, -94], [-77, -93], [-76, -93], [-76, -90], [-77, -84], [-76, -88]], [[-25, -31], [-10, 0]]]
Could anyone help me with this please?