I have a list filled with string objects. If the string object ends in a W
, I want to delete/remove the W
from the string. Also, in the only case that the string equals UW
I do not want to remove the W
.
I have tried this:
masterAbrevs = []
for subject in masterAbrevs:
if subject.endswith("W"):
subject = subject[:-1]
After printing masterAbrevs
it appears that my code is doing absolutely nothing. kindly help.