[Edu-sig] re: Terminology question: just operator overriding?

Kirby Urner urnerk@qwest.net
Mon, 30 Jun 2003 22:14:06 -0700


At 10:07 PM 6/30/2003 -0700, Kirby Urner wrote:

>  >>> p1
>  [['A', 'W', 'Z', 'R', 'N', 'G'], ['C', 'Q', 'S', 'X', ' ', 'B', 'M'],
>  ['E', 'V', 'L'], ['D', 'K', 'J', 'O', 'Y', 'P', 'H', 'T', 'U', 'F', 'I']]
>
>Using cyclic notation e.g. A goes to W, W to R and so on.

Goofed again.  A to W, W to Z, Z to R and so on (G to A).

I use the random.shuffle(list) function to jiggle the letters
and make the permutation.

      def simplecode (elems):
            neworder = elems[:]  # make copy
            random.shuffle(neworder)
            return dict( zip(elems, neworder) )

The letters are just:

      letters = list(string.ascii_uppercase + ' ')

Better quit now, before this thread becomes a never ending erratum.

Kirby