Apr-05-2018, 08:09 PM
(Apr-05-2018, 07:54 PM)nilamo Wrote:list1 = [item for item in list1 if not item.endswith("-s") and not item.endswith("-en")]
Okay i just tried it by copying this code in my script right here, but when i run it, it still posts words with these two endings. No error message. What have i done wrong? ...
with open('list2.txt') as infile: list2 = ast.literal_eval(infile.read()) list2 = [item for item in list2 if not item.endswith("-s") and not item.endswith("-en")]