On Tue, 11 Dec 2012 16:39:27 +0000, duncan smith wrote: [snip] > >>> alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" > >>> key = "XPMGTDHLYONZBWEARKJUFSCIQV" > >>> mapping = {} > >>> for i, ch in enumerate(alpha): > mapping[ch] = key[i]
mapping = dict(zip(alpha, key)) -- To email me, substitute nowhere->spamcop, invalid->net. -- http://mail.python.org/mailman/listinfo/python-list