I have used the following code to merge 2 list items. For example, list 'c' is a creation of list variables 'a' and 'b'
a=[['2022', 4], ['2023', 5]]
b=["Random1","Random2"]
c=list(zip(a,b))
'c' therefore looks like this
Out[]: [(['2022', 4], 'Random1'), (['2023', 5], 'Random2')]
i tried to sort 'c' on the 2nd and 3rd column i.e.
c_sorted=c.sort(key=lambda i:(i[1],i[2]))
however i get the error IndexError: tuple index out of range
Any help would be greatly appreciated! thanks!