I am trying to find an easy way to do this:
list1 = ['little','blue','widget']
list2 = ['there','is','a','little','blue','cup','on','the','table']
I want to get common elements of the two lists, with list1's order untouched, so this result is expected.
list3 = ['little','blue']
I am using
list3 = list(set(list1)&set(list2))
however, this only returns list3 = ['blue', 'little']
, obviously, set() just ignore the order.