Light Mode
Dark Mode
most wanted letter

def checkio(text): n = 0 s = text.lower() for i in s: if i.isalpha() and n < s.count(i): n = s.count(i) r = "z" for i in s: if i.isalpha() and s.count(i) == n and i <= r: r = i return r

Can someone explain to me why s.count(i) == n returns only the most frequent letter

Created: Dec. 20, 2018, 8:05 p.m.
Updated: Dec. 20, 2018, 9:39 p.m.
0
12
User avatar
ruslangyurov