def common (frequencies):
(8 points)
• Parameter(s): frequencies -- a list; the frequencies of letters in an unknown text (in alphabetical order)
• Return value: A tuple: the letter(s) that appeared most commonly in some piece of text
• Assumptions:
? The standard English alphabet is used: "abcdefghijklmnopqrstuvwxyz"
• How it works:
? This function should compute the letters in the alphabet that are "common" in a text.
? A "common" letter appears more than 10% of the time in a given text.
? If a letter is common, add it to the tuple of common letters.
? When you have checked all of the letters in the alphabet, return the tuple of common letters.
•
• Notes:
? The letters should be reported in alphabetical order.
? HINT: while the text itself is unknown, you can determine its length from the letter frequencies
• Examples:
? common ([0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0]) ? ('m', 'o')
? common ([4,0,0,2,7,0,0,4,7,0,0,3,0,2,1,0,0,0,7,10,0,0,0,0,0,0]) ? ('e', 'i', 's','t')