if ‘like‘ in condition: cond_str1 = condition.split(‘like‘)[0].strip() cond_str2 = condition.split(‘like‘)[1].strip() print(staff_info) ret = filter(lambda x:cond_str2 in str(x[cond_str1]), staff_info) # 这里字典写错
python报错 TypeError: string indices must be integers
原文:https://www.cnblogs.com/Mr-wangxd/p/9531770.html