May-24-2024, 05:56 PM
(This post was last modified: May-24-2024, 05:57 PM by deanhystad.)
There is nothing in the code that requires lists to be hashable. Only the keys are hashed. The iterator for a dict iterates the keys.
This is meaningless.
If you have two values that are referenced by different keys, but the lists have the same values, are the lists duplicates? Details matter. You know the problem you are trying to solve. You need to provide enough information that other understand the problem enough to provide aid.
You say you have to use lists because the keys are not unique. You are just looking at the problem wrong. I think your dictionary should look like this:
This is meaningless.
Quote:if a value is in both dicts i call this duplicate, and i want to remove it in the second dict, easy as that.In your example, SAP, C11_RG and W11_RG are duplciates, but SAG01112_SSAP_HA_LPM is unique. Are you looking for duplcate values in lists?
If you have two values that are referenced by different keys, but the lists have the same values, are the lists duplicates? Details matter. You know the problem you are trying to solve. You need to provide enough information that other understand the problem enough to provide aid.
You say you have to use lists because the keys are not unique. You are just looking at the problem wrong. I think your dictionary should look like this:
dict2 = { "SAG01112_SSAP_HA_LPM": {"OS_TYPE": "AIX"}. "IP": ["172.17.10.112", "10.111.160.119", "10.111.160.68", "10.111.160.66", "10.95.0.112", "IP", "10.111.162.119"], }