most common letter in string python

Solutions on MaxInterview for most common letter in string python by the best coders in the world

showing results for - "most common letter in string python"
Devyn
13 Jun 2020
1#find common elements present in 2 strings
2str1 = 'abcdef'
3str2 = 'abcdf'
4com_str = ''.join(set(s1).intersection(s2))
5print(com_str)
Yousra
17 Mar 2017
1>>> from collections import Counter
2>>> x = Counter("balloon")
3>>> x
4Counter({'o': 2, 'a': 1, 'b': 1, 'l': 2, 'n': 1})
5>>> x['o']
62
7