VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > temp > python入门教程 >
  • python 两个字典对比

python 两个字典对比

 
复制代码
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

 

相关教程