Nov-09-2017, 01:13 PM
That's because 'S' is a value, not a key.
if you run the snippet in my first post you will get a list of key, value pairs.
Just change the dictionary name for the different dictionaries
which version of python do you run, because my snippet is for python 3.
To get by value, use:
if you run the snippet in my first post you will get a list of key, value pairs.
Just change the dictionary name for the different dictionaries
which version of python do you run, because my snippet is for python 3.
To get by value, use:
for key, value in di1.items(): if value == 'S': print(key)