Suppose I have 3 lists,
list_of_fruits = ["apple", "banana", "orange"]
list_of_orange_things = ["carrot", "orange", "basketball"]
list_of_colors = ["orange", "green", "blue"]
Is there a way to delete "orange" from all lists simultaneously, without specifically addressing any individual list?
At a certain point while running the program, it will be important for me to remove "orange" from ALL lists. It would be helpful to have a method to remove "orange" from all lists at once, rather than removing it from each list individually.
Removing from each list individually allows for the possibility of error any time I change the number of lists in the program. It would require me to locate each place in the program where "orange" needs to removed from all lists, and double check that the lists that it will be removed from correspond to ALL lists in the program. It also creates unnecessary clutter. An alternative method would be preferred to reduce clutter and make error impossible.
My actual program procedurally generates content, and so new objects will be created and deleted all the time. It is important that the program is able to handle changes as much as possible without human interaction.