Exercise: Dictionary of dictionaries


Given the following file build a dictionary of dictionaries where each internal dictionary represents one person. The keys in the internal dictionaries are the names of the columns (fname, lname, born) the values are the respective values from each row. In the outer dictionary the keys are the (fname, lname) tuples. Create a file called dictionary_of_dictionaries.py


examples/csv/monty_python.csv
fname,lname,born
Graham,Chapman,8 January 1941
Eric,Idle,29 March 1943
Terry,Gilliam,22 November 1940
Terry,Jones,1 February 1942
John,Cleese,27 October 1939
Michael,Palin,5 May 1943

Skeleton:


examples/dictionary/dictionary_of_dictionaries_skeleton.py
# ...

print(people[('Eric', 'Idle')]['born']) # 29 March 1943