jack06215
4/19/2019 - 12:53 PM

Removing entries from ordered list, that are not in unordered list

ordered = ['salat', 'baguette', 'burger', 'pizza']
unordered = ['pizza', 'burger']

unordered = set(unordered) # into set for better performance
ordered = [item for item in ordered if item not in unordered]