hi everbody, i have a file with data: fhl1 fkh2 dfp1 chk1 mal3 alp14 mal3 moe1 mal3 spi1 mal3 bub1 mal3 bub3 mal3 mph1 mal3 mad3 hob1 nak1 i have written code to check the redudant pairs my code: data = [] data1 = [] fh = open('sheet1','r') for line in fh: if line not in data: data.append(line) else: print line
fh.close() fh1 = open('sheet2','r') for line1 in fh1: if line1 not in data1: data1.append(line1) else: print line1 fh1.close() result: klp5 bub1 apn1 apn2 but i have do the same for the revere ,to check the result like this for eg: apn2 apn1 what is the concept to do this regards shafreen
-- http://mail.python.org/mailman/listinfo/python-list