I am very new to coding and I am trying to access a key(such as 'name') that is within a nested dictionary that has a list which holds all of the Dictionaries.
Ex. I want to access the Sex of the dictionary of people.
This is the code:
people = {1: [{"name": 'John'}, {'Age': '27'}, {'Sex': 'Male'}],
2: [{"name": 'Marie'}, {'Age': '22'}, {'Sex': 'Female'}],
}
for i, x in people.items():
Accessing_People_List = people[i]
print(people[i])
print(type(people[i]))
print(Accessing_People_List[i])
So far I could only access till the list part, after that everything went as well as a cook trying to do surgery on a live person.(no offense)
So could yall give me some or any suggestions on accessing it and explain how that code to does that? (cause this is some sort of a practice for myself ) GLHF.
TL;DR: need help to access a key of a nested dictionary with a list that holds several dictionaries Edit: Btw, thanks for asking