predefined_list = ['id', 'name', 'age', 'height', 'weight']
ordering = {word: i for i, word in enumerate(predefined_list)}
sorted(['height', 'id'], key=ordering.get)
sorted(['name', 'weight', 'height'], key=ordering.get)
python sort list based on key sorted list