I want to sort lists of mathematical operators (stored as strings) in order of precedence (*,/,+,-) within a list. There are thousands of lists within my list.
E.g.
my_lists = [['*','+','-'],['-','*','*'],['+','/','-']]
should become:
new_list = [['*','+','-'],['*','*','-'],['/','+','-']]
Is there a way to sort the lists within my list in a user defined order?