2010-05-01から1日間の記事一覧

unionとintersection

http://blog.livedoor.jp/dankogai/archives/51441112.html一方、Pythonはsetの演算子を定義した。 >>> a = "0 1 2 3 4 5 6 7 8 9".split() >>> b = "0 2 4 6 8 10 12 14 16 18".split() >>> print set(a) & set(b) set(['0', '8', '2', '4', '6']) >>> prin…

このブログに乗せているコードは引用を除き CC0 1.0 で提供します。