tester client finallywe can use either the generator function or its expression equivalent in ' tester to produce scrambled arguments--the sequence scrambling function becomes tool we can use in other contextsfile scramble py def scramble(seq)for in range(len(seq))yield seq[ :seq[:igenerator function yield one item per iteration scramble lambda seq(seq[ :seq[:ifor in range(len(seq))and by moving the values generation out to an external toolthe tester becomes simplerfrom scramble import scramble from inter import intersectunion def tester(funcitemstrace=true)for args in scramble(items)if traceprint(argsprint(sorted(func(*args))use generator (orscramble (items)tester(intersect('aab''abcde''ababab')('aab''abcde''ababab'[' '' '('abcde''ababab''aab'[' '' '('ababab''aab''abcde'[' '' 'tester(intersect([ ][ ][ ])false[ [ [ permutationsall possible combinations these techniques have many other real-world applications--consider generating attachments in an email message or points to be plotted in gui moreoverother types of sequence scrambles serve central roles in other applicationsfrom searches to mathematics as isour sequence scrambler is simple reorderingbut some programs warrant the more exhaustive set of all possible orderings we get from permutations--produced using recursive functions in both list-builder and generator forms by the following module filefile permute py def permute (seq)if not seq comprehensions and generations shuffle any sequencelist