<p>我问的是如何列出个人清单。不知道如何找到标记为duplicated for的子字符串。你知道吗</p>
<p>我有以下文件</p>
<pre><code>'Gentlemen do not read each others mail.' Henry Stinson
'The more corrupt the state, the more numerous the laws.' Tacitus
'The price of freedom is eternal vigilance.' Thomas Jefferson
'Few false ideas have more firmly gripped the minds of so many intelligent men than the one that, if they just tried, they could invent a cipher that no one could break.' David Kahn
'Who will watch the watchmen.' Juvenal
'Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin.' John Von Neumann
'They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.' Benjamin Franklin
'And so it often happens that an apparently ingenious idea is in fact a weakness which the scientific cryptographer seizes on for his solution.' Herbert Yardley
</code></pre>
<p>我试着把每个句子转换成一个列表,这样当我搜索单词say“绅士”时,它就会把整个句子打印出来。
我可以得到行分裂,但我无法将它们转换为个人名单。我从网上试过一些东西,但到目前为止没有任何帮助。你知道吗</p>
<p>这是什么</p>
<pre><code>def myFun(filename):
file = open(filename, "r")
c1 = [ line for line in file ]
for i in c1:
print(i)
</code></pre>