be useful in other scenarios generalized set functions let' look at more useful example of special argument-matching modes at work at the end of we wrote function that returned the intersection of two sequences (it picked out items that appeared in bothhere is version that intersects an arbitrary number of sequences (one or moreby using the varargs matching form *args to collect all the passed-in arguments because the arguments come in as tuplewe can process them in simple for loop just for funwe'll code union function that also accepts an arbitrary number of arguments to collect items that appear in any of the operandsdef intersect(*args)res [for in args[ ]if in rescontinue for other in args[ :]if not in otherbreak elseres append(xreturn res def union(*args)res [for seq in argsfor in seqif not in resres append(xreturn res scan first sequence skip duplicates for all other args item in each onenobreak out of loop yesadd items to end for all args for all nodes add new items to result because these are tools potentially worth reusing (and they're too big to retype interactively)we'll store the functions in module file called inter py (if you've forgotten how modules and imports worksee the introduction in or stay tuned for in-depth coverage in part vin both functionsthe arguments passed in at the call come in as the args tuple as in the original intersectboth work on any kind of sequence herethey are processing stringsmixed typesand more than two sequencespython from inter import intersectunion "spam""scam""slamintersect( )union( ([' '' '' '][' '' '' '' '' ']two operands intersect([ ]( )[ mixed types intersect( [' '' '' 'three operands generalized set functions