You have a bracket in the wrong place:
print generic_drugs_mapping['MORPHINE'][0]
Your code indexes the string 'MORPHINE', so it is equivalent
print generic_drugs_mapping['M']
Since it is 'M'not the key in your dictionary, you will not get the expected results.
source
share