请帮帮我。 我的文件如下所示:
This is a cat
we are working at BusinessBrio
Gitu is my beloved cat
Jery is also a cat
Boni is a nice dog
Gitu is my beloved cat
we are working at BusinessBrio
This is a cat
we are working at BusinessBrio
Gitu is my beloved cat
Jery is also a cat
Boni is a nice dog
Gitu is my beloved cat
we are working at BusinessBrio
我需要这样的输出:
[[1,'we are working at BusinessBrio',4],[2,'Gitu is my beloved cat',4],[0,'This is a cat',2],[3,'Jery is also a cat',2],[4,'Boni is a nice dog',2]]
更多的输出必须根据重复计数按降序排序
使用
Counter
和sorted
函数输出:
相关问题 更多 >
编程相关推荐