def intersection(lst1, lst2): lst3 = [value for value in lst1 if value in lst2] return lst3 fixedList = ['116','117','114','99','102','101','95'] unorderedList = ['99','116','117'] print( intersection(fixedList,unorderedList))
https://www.geeksforgeeks.org/python-intersection-two-lists/