I currently have a list and I want to update this list by removing any of the entries that meet a particular criteria.
So, for example I have the following:
my_list = ['apple', 'pie', 'cat-video', 'dog.mp3']
my_list = [x for x in my_list if not x.endswith('-video')]
my_list = [x for x in my_list if not x.endswith('-.mp3')]
Is there an easier way to do this?