As usual, write in your diary as you do the following exercises. TeX submission required.
Test your function by calling it on a letter frequency table for a text, to convert counts to fractions.
Write a Python function that accepts a list (or other iterable) of key-value pairs where the value is numeric. The program should create a histogram of the data.stackoverflow.com/questions/11617719/how-to-plot-a-very-simple-bar-chart-python-matplotlib-using-input-txt-fileTest your function. Paste the graphic into your TeX document.
For encoding the permutation will mix up the whole alphabet. For decoding you'll want to see what the text looks like with a partial replacement - perhaps changing the most frequent letter to an e. In that case you might want to have the output an upper case E so you can see which letters you've tried to guess so far.
Write and test the Python function
def scramble( input, output, permutation, encode=True ): """ input is a text file (maybe with spaces and punctuation), output is a text file with some letters replaced by lookup in the permutation dictionary. If encode==True then output should be all lower case. If encode==False then input should be converted to lower case and output transformed letters should be upper case."""