How do I remove duplicate words from a list in python without using sets?

后端 未结 8 1740
渐次进展
渐次进展 2021-02-11 04:24

I have the following python code which almost works for me (I\'m SO close!). I have text file from one Shakespeare\'s plays that I\'m opening: Original text file:

\"Bu

8条回答
  •  野的像风
    2021-02-11 04:48

    There is a problem with your code. I think you mean:

    for word in line.split():   #for each word in line.split()
        if words not in ResultList:    #if a word isn't in ResultList
    

提交回复
热议问题