I have a dictionary that looks like this:
entryDir = {'cities': [['US', 'AU']], 'countries': [['DK', 'US']]}
And I'm trying to figure out how to print a confirmation if the values for different keys match within each list. in pseudo code:
for each key:
# {cities} {countries}
if a value for that key matches the value of another key:
#cities:US == countries:US
print key1:value1,key2:value2,"match found"
#cities:US,countries:US,"match found
if they don't match:
#cities:AU == countries:DK
print key1:value2,key2:value1,"no match"
cities:AU,countries:DK,"no match found"
What I have so far is:
for key1 in entryDir:
for key2 in entryDir:
if key1 != key2:
if entryDir[key1][0] == entryDir[key2][0]:
print entryDir[key1][0],entryDir[key2][0],"match found"
if entryDir[key1][0] != entryDir[key2][0]:
print entryDir[key2][0],entryDir[key2][0],"no match found"
But this isn't correctly matching or not matching.