Hax0r

python 교집합, Intersection of two lists 본문

0x00 개발/Python

python 교집합, Intersection of two lists

영준이 2016.04.19 12:02

c1 = [1, 6, 7, 10, 13, 28, 32, 41, 58, 63]

c2 = [[13, 17, 18, 21, 32], [7, 11, 13, 14, 28], [1, 5, 6, 8, 15, 16]]

c3 = [[13, 32], [7, 13, 28], [1,6]]


c3 = [filter(lambda x: x in c1, sublist) for sublist in c2]

0 Comments
댓글쓰기 폼
Prev 1 2 3 4 5 6 7 8 9 Next