Suppose I have these lists:
ids = [4, 3, 7, 8] objects = [ {"id": 7, "text": "are"}, {"id": 3, "text": "how"}, {"id": 8, "text": "you"}, {"id": 4, "text": "hello"} ]
How can I sort objects so that the order of their ids matches ids ? That is, to get this result:
objects = [ {"id": 4, "text": "hello"}, {"id": 3, "text": "how"}, {"id": 7, "text": "are"}, {"id": 8, "text": "you"} ]
Timmmm
source share