Ian's MOAR DICTIONARY STUFF Post

by Ian Moore

07 Apr 2016

This is exercise 1:

This exercise was relatively straightforward. It feels in some ways like a great prelude to the assignment that was due on Tuesday. I had forgotten about the random package for a little while, and it was fun to pull it out and assign a random value to each key.

This Trinket contains the rest of the exercises:

I’d like to focus on Exercise 4, which presented the most significant challenge for me. The answer I developed for it is janky. It functions for me, which is great, but I think that’s a fluke more than anything. In essence, I think that I programmed around the problem, rather than solving it as such. I based my solution on the assumption that a dictionary will appear in the same order for the duration of the run of a program. My testing bore this out, which is lovely for me, I suppose, but it doesn’t seem to me that making two lists and depending on them appearing in the same order is a great way to go. My inability to print the key and the value without just printing a list was also frustrating, but I think it’s a secondary frustration, given that I did manage to solve the rest.

Ian is a first-year MLS student in SILS, and he's not very good at writing his own bio. Find Ian Moore on Twitter, Github, and on the web.