Ga Kay and Jasmine's Dictionary Exercises

by Jasmine Plott and Ga Kay Gao

05 Apr 2016

Here are the dictionary exercises that Ga Kay and I completed:

Reflecting back on our experiences working through these exercises, we were able to get the first two parts of the exercise pretty easily, but it was tricky to get parts 3 and 5 to work the way that we wanted them to. The biggest learning curve for us with the 3rd exercise was figuring out how to put a dictionary within a dictionary and the appropriate formatting for it. Creating the dictionary itself was not so difficult as was figuring out how to get the values for a state that had already been entered to count. We discovered that in order to make this happen, we needed to make it an integer. Thus, after a good deal of trial and error, we got it. The 5th exercise was tricky for us in that we had to think about what we actually wanted the program to evaluate for try and except. The lightbulb went on when we realized that we needed to put the portion of code that asked for user input outside the try and except, and if the user entered a file name that wasn’t an option, we just had them exit the program rather than loop through. It’ll be good to get some more dictionary practice in the future.

Jasmine Plott is a first year masters student in the School of Information and Library Science at UNC Chapel Hill. She is a librarian in training and slowly developing her programming skills. Find Jasmine Plott on Twitter, Github, and on the web.
Ga Kay is currently a sophomore studying Information Science at UNC-Chapel Hill. Find Ga Kay Gao on Twitter, Github, and on the web.