def checkio(text):
t_count = 0
t_value = ''
text_lower = text.lower()
list = sorted(text_lower)
for i in list:
if i >= 'a' and i <= 'z':
if text.count(i) > t_count:
t_count=text.count(i)
t_value=i
print t_value
checkio("Aaaooo") #打印的是o
checkio("aaaooo") #打印的是a
为什么会出现这个情况,
text_lower = text.lower() 不是已经将所有的字符转为小写了吗?
t_count = 0
t_value = ''
text_lower = text.lower()
list = sorted(text_lower)
for i in list:
if i >= 'a' and i <= 'z':
if text.count(i) > t_count:
t_count=text.count(i)
t_value=i
print t_value
checkio("Aaaooo") #打印的是o
checkio("aaaooo") #打印的是a
为什么会出现这个情况,
text_lower = text.lower() 不是已经将所有的字符转为小写了吗?