How to remove specific substrings from a set of strings in Python? : <p>I have a set of strings <code>set1</code>, and all the strings in <code>set1</code> have a two specific substrings which I don't need and want to remove. <br/>
Sample Input:
<code>set1={'Apple.good','Orange.good','Pear.bad','Pear.good','Banana.bad','Potato.bad'}</code><br/>
So basically I want the <code>.good</code> and <code>.bad</code> substrings removed from all the strings. <br/>What I tried:</p>

<pre><code>for x in set1:
    x.replace('.good','')
    x.replace('.bad','')
</code></pre>

<p>But this doesn't seem to work at all. There is absolutely no change in the output and it is the same as the input. I tried using <code>for x in list(set1)</code> instead of the original one but that doesn't change anything.  </p>
