공부
[Python] `not in` & `diff` & `subtract` list
승가비
2020. 5. 2. 21:21
728x90
[item for item in x if item not in y]
https://stackoverflow.com/questions/3428536/python-list-subtraction-operation
Python list subtraction operation
I want to do something similar to this: >>> x = [1,2,3,4,5,6,7,8,9,0] >>> x [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] >>> y = [1,3,5,7,9] >>> y [1, 3, 5, 7, 9] ...
stackoverflow.com
728x90