这个python程序怎么写啊?

img

参考下面的写下,字符串分割你总能搞定吧,按空格,感叹号,引号分割就行了


from collections import Counter
list = ['apple', 'peach','apple','banana','banana','orange','apple']
list.sort()
N = len(list)
print(Counter(list).most_common(N))

效果:

img