小编Bha*_*ath的帖子

在一行文本文件中查找许多唯一的单词

我想创建一个Python程序来查找文本文件中一行中的唯一单词.

文本文件"details"具有以下行

My name is crazyguy
i am studying in a college and i travel by car
my brother brings me food for eating and we will go for shopping after food.
Run Code Online (Sandbox Code Playgroud)

它必须返回输出为

4
10 #(since i is repeated)
13 #(Since food and for are repeated)
Run Code Online (Sandbox Code Playgroud)

如果代码有效,那么在挖掘数据时,它对于更大的文本文件是否会以相同的方式工作?

python text

1
推荐指数
2
解决办法
921
查看次数

标签 统计

python ×1

text ×1