I have a dictionary like this:
{
"0": {},
"1": {},
"2": {},
"3": {},
"4": {},
"5": {},
"6": {},
"7": {},
"8": {},
"9": {},
"10": {},
"11": {},
"12": {
"PNR": "51313542"
},
"13": {},
"14": {},
"15": {
"PNR": "13151351351"
},
"16": {
"PNR": "13151351351"
},
"17": {
"PNR": "13151351351"
},
"18": {
"PNR": "13151351351"
},
"19": {
"PNR": "13151351351"
},
"20": {
"PNR": "13151351351"
},
"21": {
"PNR": "13151351351"
},
"22": {
"PNR": "13151351351"
},
"23": {
"PNR": "13151351351"
},
"24": {
"PNR": "13151351351"
}
}
I wanted to get only the PNR's and creating an array with them.
I tried this for getting the PNR values (think "output" as my dict):
d_ = output.get("PNR")
But it gives None.
How can I get the PNR values no matter how many elements in my dict and create an array with them?
PNRkey in specific sub-dict?