I have created a list, lets call it master list
master=['abc 1.2 px', 'pqr 5.4 tr', '1.8 cmq', 'pst 2.5']
Now I am having another list like
l1=['1.2 abc px', 'pqr tr 5.4', 'cmq 1.8', '1.8 cmq', '2.5 pst', 'abc 1.2 px']
I want to modify l1 which will take the names from master where all words are presents irrespective of sequence. for example the modified list will be
l2=['abc 1.2 px', 'pqr 5.4 tr', '1.8 cmq', '1.8 cmq', 'pst 2.5','abc 1.2 px']
How to do it using python ?