**extract_barcode.py** <br /> for barcode in blist: if sum([barcode in b for b in blist]) > 1: overlap = True "startswith" is better than "in": if sum([b.startswith(barcode) b for b in blist]) > 1 For example, ACG and TACG are not overlapped.