I have the following task, there is a list of letters:
list = "AaaBbBCcDdddGggPpjjJ" I need to count the number of letters in the list and display the letters - which appears in the list the maximum number of times.
The decision with counting letters, I see the following:
list = ( ", ".join("%s : %s" % (i, a.count(i)) for i in sorted(set(a.lower())))).split(',') print(list) It turns out the following list:
['a : 2', ' b : 1', ' c : 1', ' d : 3', ' g : 2', ' j : 2', ' p : 1'] Now, the task is to remove from this list the most frequently used letter. It seems to me that if I convert this list to a dictionary, then by the maximum value I can get the desired result.
{a:2}, {b:1}, {c:1} и т.д. But bad luck, I can not figure out how to do it?
for symbol in "abcd":at each step we will receive exactly the string that just consists of one symbol (unlike most other languages). And the properties of the string"abc"quite different from the properties of the list (sequence) of "characters"['a', 'b', 'c']- andy.37