but they also support three or more operands notice the use of an else on the intersection' for loop here to detect common items also note that the last two examples in the following session work on lists with embedded compound objectsthe in tests used by the intersect and union functions apply equality testing to sequence nodes recursivelyas deep as necessary to determine collection comparison resultsc:\pp \dstruct\basicpython from inter import 'spam''slam''scamintersect( [' '' '' 'intersect( [' '' '' 'intersect( 'ham'[' '' 'union( )union( ([' '' '' '' '' '][' '' '' '' '' '' ']intersect([ ]( )range( )[ ( ( )"bye"[ ]"mello" [[ ]"hello"( ) intersect( [ [ ]union( [ ( )'bye'[ ]'mello''hello'( ) xrange okay set classes the preceding section' set functions can operate on variety of objectsbut they aren' as friendly as true objects among other thingsyour scripts need to keep track of the sequences passed into these functions manually classes can do betterthe class in example - implements set object that can hold any type of object like the stack classesit' essentially wrapper around python list with extra set operations example - pp \dstruct\basic\set py "multi-instancecustomizableencapsulated set classclass setdef __init__(selfvalue [])self data [self concat(valuedef intersect(selfother)res [for in self dataif in otherres append(xreturn set(reson object creation manages local list other is any sequence type self is the instance subject return new set implementing sets