参考1 https://blog.csdn.net/weixin_44151034/article/details/124286429
参考 2 参考代码
def is_diff_ele(list1, list2): """ 判断两个列表元素是否一致(不是两个列表是否相同) True: 一致; False: 不一致 """ set1 = set2 = set() if list1: set1 = set(list1) list1 = list(set1) if list2: set2 = set(list2) list2 = list(set2) if len(list1) != len(list2): return False for i in list1: if i not in set2: return False for j in list2: if j not in set1: return False return True
标签:return,python,list,list1,list2,set1,set2,False,比较 From: https://www.cnblogs.com/tslam/p/16628773.html