Replace element in list with white space
<p>Is it possible to check element of list? If it has the same word as in "test01.txt" then replace with space?</p>

<p>test01.txt:</p>

<pre><code>to
her
too
a
for
</code></pre>

<p>In the codes:</p>

<pre><code>with open('C:/test01.txt') as words:
    ws = words.read().splitlines()
with open('C:/test02.txt') as file_modify4:
    for x in file_modify4:
        sx = map(str.strip, x.split("\t"))
        ssx = sx[0].split(" ")
        print ssx
</code></pre>

<p>Results from "print ssx":</p>

<pre><code>['wow']
['listens', 'to', 'her', 'music']
['too', 'good']
['a', 'film', 'for', 'stunt', 'scheduling', 'i', 'think']
['really', 'enjoyed']
</code></pre>

<p>How to replace the element in ssx? </p>

<p>Expected result:</p>

<pre><code>['wow']
['listens', ' ', ' ', 'music']
[' ', 'good']
[' ', 'film', ' ', 'stunt', 'scheduling', 'i', 'think']
['really', 'enjoyed']
</code></pre>

<p>Any suggestion?</p>
