def duplicates(inlist):
    """
Returns duplicate items in the FIRST dimension of the passed list.

Usage:   duplicates (inlist)
"""
    dups = []
    for i in range(len(inlist)):
        if inlist[i] in inlist[i+1:]:
            dups.append(inlist[i])
    return dups
def duplicates ( inlist ) : dups = [ ] for i in range ( len ( inlist ) ) : if inlist [ i ] in inlist [ i + 1 : ] : dups . append ( inlist [ i ] ) return dups
Returns duplicate items in the FIRST dimension of the passed list.

Usage:   duplicates (inlist)