def commir_two_dict(dictone,dicttwo): pass_num=0 fail_num=0 try: for i in dictone.keys(): if i in dicttwo.keys(): pass_num+=1 else: fail_num+=1 for j in dictone.values(): if j in dicttwo.values(): pass_num+=1 else: fail_num+=1 except Exception as e: fail_num+=1 if fail_num>0: return False else: return True
出 处:https://www.cnblogs.com/leiziv5/p/11218848.html