I am new to coding and I am trying to extract 2 lists from the following nested dictionary:
dict : {'player2': {'player': 'player2', 'firstname': 'Ross', 'lastname': 'Estrada'}, 'player3': {'player': 'player3', 'firstname': 'Melvin', 'lastname': 'Graves'}, 'player0': {'player': 'player0', 'firstname': 'Alfredo', 'lastname': 'Hopkins'}, 'player1': {'player': 'player1', 'firstname': 'Jay', 'lastname': 'Ramos'}, 'player6': {'player': 'player6', 'firstname': 'Claudia', 'lastname': 'Brown'}, 'player7': {'player': 'player7', 'firstname': 'Ben', 'lastname': 'Carson'}, 'player4': {'player': 'player4', 'firstname': 'Virginia', 'lastname': 'Harmon'}, 'player5': {'player': 'player5', 'firstname': 'Caleb', 'lastname': 'Reese'}, 'player8': {'player': 'player8', 'firstname': 'Olivia', 'lastname': 'Olson'}, 'player9': {'player': 'player9', 'firstname': 'Amy', 'lastname': 'Valdez'}}
The first list should contain all the first names, whereas the second list should contain all the second names.
The problem is that I do not know what key to use to signal all outer keys rather than just one.
So, for example I know dict["player2"]["firstname"]
will return the player2's firstname, but how can I write this to extract all the firstnames at once.
Thanks for your help!