def find_sym(input_list): res = [] for a in input_list: to_list = list(a) ll = len(to_list) m, f = ll / 2, True for b in range(m): if to_list[b] == to_list[ll - b - 1]: continue else: f = False break if f: res.append(a) return res
输入:find_sym(['001100', '11011', '123456754321', '12345654321','123456654321'])
输出:['001100', '11011', '12345654321', '123456654321']