擅长:python、mysql、java
<pre><code>data = {
'jan': ['John Smith', 'Cat Stevens', 'Andrew Alexander', 'El Gordo Baba'],
'feb': ['Louis le Roy', 'John Smith'],
'mar': ['Cat Stevens', 'Louis le Roy']
}
from itertools import izip
keys = 'jan feb mar'.split()
for m1,m2 in izip(keys,keys[1:]):
a = set(data[m1])
b = set(data[m2])
print m1, '\n\tsubscribed:', ','.join(b-a), '\n\tquit:', ','.join(a - b )
</code></pre>
<p>结果:</p>
^{pr2}$