Run
mylist = [21, 5, 8, 52, 21, 87] r_item = 21 #remove the item for all its occurrences mylist = list(filter((r_item).__ne__, mylist)) print(mylist)
Output