我有两个字典:
dict1 = {'Warning': [{'User account': 'User doesnot exist'},
{'Login': 'Login failed'}],
'Error': [{'Monitoring': 'Monitoring failed due to system crash'},
{'Scheduler': 'Scheduler stopped running'}]}
dict2 = {'Warning': [{'User account': 'User doesnot exist'},
{'Login': 'Multiple logins attempted'},
{'Version': 'Version doesnot match'}],
'Error': [{'Monitoring': 'Monitoring failed due to system crash'},
{'Scheduler': 'Scheduler never inititated'}],
'Critical': [{'Memory': 'Memory overflow'}]}
我必须比较两个字典,如果dict2的值(字典列表)在dict1中不常见,则必须返回它们: 预期的输出是:
result = {'Warning': [{'Login': 'Multiple logins attempted'},
{'Version': 'Version doesnot match'}],
'Error': [{'Scheduler': 'Scheduler never inititated'}],
'Critical': [{'Memory': 'Memory overflow'}]}
我们非常感谢您的帮助。