티스토리 뷰

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

'공부' 카테고리의 다른 글

[Spring] boot `/error` handling  (0) 2020.05.02
[Sh] remove string  (0) 2020.05.02
[Hive] show create table schema  (0) 2020.05.02
[Browser] read clipboard  (0) 2020.05.02
[Chrome] extension Icon Manifest  (0) 2020.05.02
댓글