Python 找出陣列中的相同值


1
2
3
4
5
6
7
# -*- coding: utf-8 -*-

a = ["11","22","33"]
b = ["11","33"]
c = set(a) & set(b)

print c #输出 set(['11', '33'])