I have a set of strings set1, and all the strings in set1 have a two specific substrings which I don't need and want to remove.
Sample Input:
set1={'Apple.good','Orange.good','Pear.bad','Pear.good','Banana.bad','Potato.bad'}
So basically I want the .good and .bad substrings removed from all the strings.
What I tried:
for x in set1:
x.replace('.good','')
x.replace('.bad','')
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 for x in list(set1) instead of the original one but that doesn't change anything.
