def list_equal(list1: list, list2: list) -> bool: """ Determine whether the values of two lists are exactly the same :param
list1:123 :param list2: :return: Boolean value """ list_result = [] len1 = len(list1) len2
= len(list2) if len1 == len2: for i in list1: if i in list2 and list1.count(i)
== list2.count(i): list_result.append(True) else: list_result.append(False) if
False in list_result: return False else: return True else: log.error(
" The values in the two lists are not the same , And the length is not consistent ") if __name__ == '__main__': list3 = [1, 2, 3, 2] list4 = [3
, 2, 2, 1] x = list_equal(list1=list3, list2=list4) print(x)
Technology
Daily Recommendation