Avatar ·

Python, how to sort the list based on another list?

📁 python

  BOX_B = [ 7 ,  3 ,  9 ,  5 ] box_a = [Apple, Banana, Cherry, Lemon]     

The essence is that after sorting box_b I need box_a sorted in the same way.

  # after sorting box_b and some algorithm* box_b = [ 3 ,  5 ,  7 ,  9 ] box_a = [Banana, Lemon, Apple, Cherry]