Python Remove Values in List From Another List

May 18, 2019
items = [1, 2, 3, 4, 5]
remove_items = [3, 5, 7]
remaining_items = list(set(items) - set(remove_items))

Result of remaining_items

[1, 2, 4]
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.