I have 2 lists : result, occurredtimes I want to sort them based on the occurredtimes
These are printed outputs of the lists :
result is ['3 - 1', '1 - 2', '0 - 0', '2 - 1', '2 - 3', '2 - 0' ...]
occurredtimes is [322 , 423, 269, 643, 114, 565 ...]
The output I need is
result ['2 - 1', '2 - 0', '1 -2', '3 - 1', '0 - 0', '2 - 3' ...]
occurredtimes [643 , 565, 423, 322, 269, 114 ...]
I am trying to sort them but I cannot get what I need; I am sorry, I am sure it is an easy code
I tried as follows
result, occurredtimes = (list(t) for t in zip(*sorted(zip(result, occurredtimes))))