[Solved] How to get specific value in dictionary python?


If you mean that you have several fields like 98 but they all contain a title, you could do this:

titles = list()
for k in my_dict["countries"].keys():

    if my_dict["countries"][k].has_key("title"):

        titles.append(my_dict["countries"][k]["title"])

or, as suggested in the comments

try:
    titles = [item['title'] for item in dictName['countries']]
except KeyError:
    print("no countries/title")

solved How to get specific value in dictionary python?