I have searched through stackoverflow but can't find a suitable solution,
I have two list list_A and list_B.
the strings in list_A are of varying length while list_B contains the last two or three char in list a that are unique
list_A = ['SedimentDB','SeedDB', 'FloorCD', 'QuanCD', 'DewDB', 'AsiaDMS', 'AfriDMS', 'EuroDMS']
List_B = ['DMS', 'CD', 'DB']
i would like to sort List_A based on the order of List_B.
the result should be similar to
List_A = ['AsiaDMS', 'AfriDMS', 'EuroDMS', 'FloorCD', 'QuanCD', 'SedimentDB','SeedDB', 'DewDB']
thanks.