输入:[‘eat’,‘ate’,‘tea’,‘like’,‘kile’,‘liek’,‘ielk’]
输出:[[‘eat’,‘ate’,‘tea’],[‘like’,‘kile’,‘liek’,‘ielk’]]
a_list = ['eat','ate','tea','like','kile','liek','ielk']def list_group(a_list):len_list = len(a_list)result = []dict_location = {}for value_i in a_list:s = "".join((lambda x:(x.sort(),x)[1])(list(value_i)))dict_location_keys = dict_location.keys()if s not in dict_location_keys:dict_location[s] = len(dict_location_keys)result.append([s])else:result[dict_location[s]].append(value_i) return resultlist_group(a_list)