擅长:python、mysql、java
<p>使用Python<a href="http://docs.python.org/library/stdtypes.html#set" rel="nofollow">sets</a></p>
<pre><code>listA = (
('chr1', 'aatt'),
('chr8', 'tagg'),
('chr11', 'aaaa'),
('chr7', 'gtag'),
)
listB = (
('chr8', 'tagt'),
('chr1', 'tttt'),
('chr7', 'gtag'),
('chr11','aaaa'),
('chr9', 'atat'),
)
combined = set(listA).intersection(set(listB))
for c, d in combined:
print c, d
</code></pre>
<p>您也可以像这样使用<code>&</code>:</p>
^{pr2}$