First page Back Continue Last page Overview Graphics

Exercise

Write a function, which determines the frequency of letters of a text.

A sorted (frequency) list with the letters and their frequency shall be returned.

Special characters and digits shouldn't be counted.

Example:

string = "Monty Python"

x = letter_frequency(string)

print(x)

Output:

[('o', 2), ('n', 2), ('t', 2), ('y', 2), ('h', 1), ('m', 1), ('p', 1)]