Question: Write a function that converts a text file into one where all letters are in capitals and where all punctuation symbols and white spaces are
Write a function that converts a text file into one where all letters are in capitals and where all punctuation symbols and white spaces are suppressed. You can keep the end-line characters. Then use the function from the first task in order to count the number of letters in a number of english text files. Compare the numbers you obtained with the frequencies according to wikipedia. You are given a cipher text encrypted with a secret substitution code. (We can figure out that it is a substitution code because the frequencies of the letters in it correspond to the frequency of English letters. This also means that we can distinguish between clear texts in various languages). By looking for the most frequent letters in the cipher and comparing them to the frequencies of English letters, you can make a number of guesses for substitutions. For instance, the letter substituted for E is the most frequent letter in the cipher. This method breaks down for smaller frequency counts because the frequency counts differ between texts. (In python)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
