String manipulation in python..NEED HELP!!!!

Peter Pearson ppearson at nowhere.invalid
Tue Dec 11 23:21:18 CET 2012


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.



More information about the Python-list mailing list