<be************@gmail.comwrote:
Hi all,See "Set Types", http://docs.python.org/lib/types-set.html. Example:
I need to find the intersection of 10 different files with ids definedas
a_items, b_items and so on
common_items = a_items&b_items&c_items&\
d_items&e_items&f_items\
&g_items&h_items&i_items&j_items
i have included above line in the script
is this an right way will my program accept it or what are the other
option
to compare 10 different such items
s1 = set([1,2,3])
s2 = set([3,4,5])
s1 & s2
set([3])
You can populate your sets using an iterable, such as the lines from a
file. Example:
s1 = set(file(r'blah.txt'))
--
Kam-Hung Soh <a href="http://kamhungsoh.com/blog">Software Salariman</a>