write self-checks sometimes you can write code to check for errors automatically for exampleif you are computing the average of list of numbersyou could check that the result is not greater than the largest element in the list or less than the smallest this is called "sanity checkbecause it detects results that are "completely illogicalanother kind of check compares the results of two different computations to see if they are consistent this is called "consistency checkpretty print the output formatting debugging output can make it easier to spot an error againtime you spend building scaffolding can reduce the time you spend debugging glossary dictionary mapping from set of keys to their corresponding values hashtable the algorithm used to implement python dictionaries hash function function used by hashtable to compute the location for key histogram set of counters implementation way of performing computation item another name for key-value pair key an object that appears in dictionary as the first part of key-value pair key-value pair the representation of the mapping from key to value lookup dictionary operation that takes key and finds the corresponding value nested loops when there are one or more loops "insideof another loop the inner loop runs to completion each time the outer loop runs once value an object that appears in dictionary as the second part of key-value pair this is more specific than our previous use of the word "value exercises exercise write program that categorizes each mail message by which day of the week the commit was done to do this look for lines that start with "from"then look for the third word and keep running count of each of the days of the week at the end of the program print out the contents of your dictionary (order does not mattersample linefrom stephen marquard@uct ac za sat jan sample executionpython dow py enter file namembox-short txt {'fri' 'thu' 'sat' : :