fork(1) download
  1. list_of_strings = ['test-1: foo', 'test-2: bar', 'test-3: cat']
  2. # switch to a tuple
  3. tuple_of_prefixes = ('test-1', 'test-2')
  4.  
  5. final_list = []
  6. for i in list_of_strings:
  7. if not i.startswith(tuple_of_prefixes):
  8. final_list.append(i)
  9.  
  10. print(list(set(final_list)))
Success #stdin #stdout 0.01s 7316KB
stdin
Standard input is empty
stdout
['test-3: cat']